home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TP051792.ARJ / 05-17-92.TPC
Text File  |  1992-05-17  |  93KB  |  2,888 lines

  1.  
  2. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  3.  
  4. Conference 4
  5. Date       01-01-00 00:00:00
  6. From       
  7. To         
  8. Subject    
  9.  
  10.  
  11. --- WM v2.01/92-0100
  12.  * Origin: A.C.E. of Spades (615)383-4381 The B.A.N. board (1:116/33)
  13.  * Tossed by SFToss v1.00b on 92/04/09  12:01:00
  14.  
  15. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  16.  
  17. Conference 4
  18. Date       05-10-92 17:57:07
  19. From       Trevor Carlsen
  20. To         Peter Beeftink
  21. Subject    The function "pos"
  22.  
  23.  
  24.  
  25.  PB> The function "pos" finds a substring within a larger string.  Is there 
  26.  
  27.  PB> a neat way to make the search independent of upper or lower case?
  28.  PB> For instance, if my substring is all uppercase, let it find that 
  29.  PB> substring in the main string if it has mixed case letters there?
  30.  
  31. The best way would be for you to get a copy of Eagle Software's string package
  32. or Turbo Power's Object Professional package.
  33.  
  34. The former has a string unit that is about as fast and as complete as is possibl
  35. , is shareware (although the registered version is more complete) and has
  36. exactly what you want.
  37.  
  38. If you do not wish to do this then your only option is to turn both strings
  39. to the same case before you call the pos function.
  40.  
  41. TeeCee
  42.  
  43.  
  44. --- TC-ED   v2.01  
  45.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  46.  * Tossed by SFToss v1.00b on 92/05/10  19:09:30
  47.  
  48. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  49.  
  50. Conference 4
  51. Date       05-10-92 08:50:44
  52. From       Dj Murdoch
  53. To         BRIAN PAPE
  54. Subject    Re: TP 6.0 BUG LIST (RELEASE 
  55.  
  56.   BP> And that list doesn't even include the annoying bugs in the IDE...
  57.  
  58. The point of the list isn't Borland-bashing, it's the fact that if you're
  59. using a compiler, you're much better off to have a list of the bugs than not.
  60.  I'd list bugs in the IDE, if there were any that affected the way it compiles
  61. programs, but I've never been told of any.
  62.  
  63. If I wanted to bash Borland, it would be because there was no such list availabl
  64.  for TP before 6, and because it's such a lot of trouble for me to maintain
  65. the list, when they should be doing it.
  66.  
  67. Since I don't have a pre-6 list, I can't say this for sure, but my gut feeling
  68. is that TP 6.01 is a somewhat safer compiler to use than any of TP 4-5.5.
  69.  
  70.  
  71. --- Msg V3.2
  72.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  73.  * Tossed by SFToss v1.00b on 92/05/11  08:11:00
  74.  
  75. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  76.  
  77. Conference 4
  78. Date       05-10-92 08:59:23
  79. From       Dj Murdoch
  80. To         Greg Williams
  81. Subject    Re: Customising TV...
  82.  
  83.   GW> Has anyone come up with a good way to totally revamp TV menus and dialogs?
  84.  GW> I'm trying to work out how far "down" you can go in 
  85.  GW> modifying the LOOK while still keeping the functionality.
  86.  GW> For example, adding shadows to the boxes and making the 
  87.  GW> border characters used configurable is a high priority at present.
  88.  GW> Yurrrkkk - just can't handle that green, chunky feel.... :->
  89.  
  90. A lot of those thinks are controlled by private fields/methods.  For example,
  91. when I was working on a monochrome monitor, I *hated* the TV scroll bars:
  92.  they make the mouse cursor disappear.  To fix them, I had to modify a private
  93. field (sorry, I forget which one) which contained all the scroll bar characters.
  94.  
  95. Obviously, the safest way to modify private fields is to get the TV source
  96. and work with it.  However, if you want, there's another way:  you can patch
  97. a .TPU to make private fields/methods public.  Each field in an object declarati
  98. n has a single bit to determine public vs. private.  Just go in and flip that
  99. bit, and you'll be able to modify private fields.
  100.  
  101. Finding the bit isn't easy, but Peavey's TPU6.ZIP or TWU1.ZIP (both of which
  102. I've sent out on PDN) help a lot.  My INTRFC62.ZIP (also on PDN) gives a nicer
  103. looking display, IMO, but doesn't give the file offsets or the detail you'd
  104. need for patching.
  105.  
  106. --- Msg V3.2
  107.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  108.  * Tossed by SFToss v1.00b on 92/05/11  08:11:00
  109.  
  110. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  111.  
  112. Conference 4
  113. Date       05-10-92 09:31:29
  114. From       Dj Murdoch
  115. To         Mike Normand
  116. Subject    Re: Over my head....
  117.  
  118.   MN> It is important to state that the names are in a data base 
  119.  MN> and not DOS based files....  I cant just call up the Dos 
  120.  MN> services and do pattern matching.
  121.  ...
  122.  MN> I can get the program to work if I dis-allow the ? 
  123.  MN> character and only allow the * character....but I would 
  124.  MN> like to have both fully usable.
  125.  
  126. Here's how I'd do it:
  127.  
  128. First, translate the *s into ?s.  For example, ABC*.* should be changed to
  129. ABC?????.???.  It's probably also a good idea to map lower case characters
  130. to upper case ones at this point.
  131.  
  132. Then, when you want to check whether a particular file matches, first put
  133. it into the same 8.3 form:  abcd.pas would become "ABCD    .PAS".  (The period
  134. could be stripped out in both cases, if you like.)
  135.  
  136. Now checking whether the file matches the pattern is easy:  just loop through
  137. the filename, and abort if the character doesn't match the pattern, and the
  138. pattern isn't a ?:
  139.  
  140. match := false; for i:=1 to len do
  141.   if (pattern[i] <> '?') and (pattern[i] <> filename[i]) then
  142.     exit; match := true;
  143.  
  144. I hope this helps.
  145.  
  146.  
  147. --- Msg V3.2
  148.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  149.  * Tossed by SFToss v1.00b on 92/05/11  08:11:00
  150.  
  151. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  152.  
  153. Conference 4
  154. Date       05-10-92 09:43:03
  155. From       Dj Murdoch
  156. To         Bob Bannon
  157. Subject    Re: Impact of .TPU size on .EXE size
  158.  
  159.   BB> Suppose someone has numerous TP unit files that each 
  160.  BB> contains a large number of procedures.  Assume also that I 
  161.  BB> want to write a small program that has the misfortune of 
  162.  BB> needing JUST ONE procedure from each of the several large 
  163.  BB> units, thus causing me to have to include ALL the units in 
  164.  BB> my USES statement.
  165.  BB>  
  166.  BB> My question is this: when the program is compiled to disk 
  167.  BB> as an .EXE file, does TP compile into my program all the 
  168.  BB> extraneous procedures that I am not using from all the 
  169.  BB> different .TPU files, thus causing my .EXE file to be 
  170.  BB> excessively large, or does TP just take the code for the 
  171.  BB> procedures that I use (I suspect the former is correct but 
  172.  BB> I just wanted to check)?  
  173.  
  174. Your suspicion is wrong.  The "smart linker" only includes the procedures
  175. (and data) that you reference (directly or indirectly).
  176.  
  177. There are a few surprises though.  These are all documented, but you might
  178. not have noticed them:
  179.  
  180. 1. Just using a unit counts as a reference to its initialization section.
  181.  The initialization section probably makes references to data and code in
  182. the unit, so you'll get that whether you expect it or not.  
  183.  
  184. 2. Data isn't pulled in variable-by-variable, it's pulled in by declaration
  185. block.  For example, if you have global declarations
  186.   var
  187.     important : byte;
  188.     junk : array[1..20000] of byte; and you make a reference to important,
  189. the linker will also put junk in your .EXE.  Add an extra "var" before junk,
  190. and this won't happen.
  191.  
  192. 3.  Code is generally pulled in procedure by procedure, but not for external
  193. code.  If you link external .OBJ files, any reference to the .OBJ code pulls
  194. in the whole .OBJ.  This, together with 1, means that the program
  195.   uses
  196.     crt;
  197.   begin
  198.   end.  ends up much larger than 
  199.   begin
  200.   end.  because the former one links in most of the CRT unit code and data.
  201.  
  202.  
  203. --- Msg V3.2
  204.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  205.  * Tossed by SFToss v1.00b on 92/05/11  08:11:01
  206.  
  207. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  208.  
  209. Conference 4
  210. Date       05-10-92 16:11:46
  211. From       Dj Murdoch
  212. To         Jud Mccranie
  213. Subject    Re: Pascal Style #2
  214.  
  215.   JM> Which is better Pascal style:
  216.  
  217.  JM> x := 1;
  218.  JM> if y > 10 then x := 2;
  219.  
  220.  JM> or
  221.  
  222.  JM> if y > 10
  223.  JM>   then x := 2
  224.  JM>   else x := 1;
  225.  
  226.  JM> I'm more concerned with the programmer-level reasons, rather than
  227.  JM> execution speed or code size.
  228.  
  229. I use both, depending on the particular situation.  If the "y > 10" condition
  230. is a weird exception, I'll always code it the first way, to emphasize that
  231. x := 1 is "normal", and x := 2 is "special".  But if "y > 10" is just as likely
  232. as "y <= 10", I'll use the second one, to emphasize the symmetry.  When things
  233. aren't quite balanced, but are relatively close, I like to put the most likely
  234. branch first.
  235.  
  236.  
  237.  
  238. --- Msg V3.2
  239.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  240.  * Tossed by SFToss v1.00b on 92/05/11  08:11:01
  241.  
  242. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  243.  
  244. Conference 4
  245. Date       05-11-92 18:07:08
  246. From       Trevor Carlsen
  247. To         Mike Normand
  248. Subject    Over my head....
  249.  
  250.  
  251.  
  252.  MN> I am trying to get a routine that will allow a person to enter the 
  253.  MN> name of a file that is stored in a typed record and then pull out all 
  254.  
  255.  MN> the files that match the users input.
  256.  MN> 
  257.  MN> I can get it to work fine if they dont use any wildcards, but I want 
  258.  
  259.  MN> to fully impliment the ? and * into the program.
  260.  MN> 
  261.  MN> It is important to state that the names are in a data base and not DOS 
  262.  
  263.  MN> based files....  I cant just call up the Dos services and do pattern 
  264.  
  265.  MN> matching.
  266.  MN> 
  267.  MN> I want to be able to enter a Filename such as ABC??.* and have the 
  268.  MN> program pull all the matches out of the database...and thats where I 
  269.  
  270.  MN> am stuck
  271.  
  272. Try this (untested) code -
  273.  
  274. It will require that you first split both the FileName and the mask into name
  275. and extension and convert to uppercase.  The example uses Eagle's StrUpr procedu
  276. e to convert to uppercase.
  277.  
  278. type
  279.   str8  = string[8];
  280.  
  281. procedure ParseFileName(st: string; var name,ext: str8);
  282.   var x : byte;
  283.   begin
  284.     StrUpr(st);
  285.     x := pos('.',st);
  286.     if (x <> 0) and (x <> length(st)) then
  287.       name := copy(st,1,x-1)
  288.     else begin
  289.       name := st;
  290.       ext  := '';
  291.       exit;
  292.     end;
  293.     ext := copy(st,x+1,3);
  294.   end; { ParseFileName }
  295.  
  296. function Matches(name: str8; mask: str8): boolean;
  297.   var
  298.     x         : byte;
  299.     GoodSoFar : boolean;
  300.   begin
  301.     GoodSoFar := true;
  302.     for x := 1 to length(mask) do
  303.       if (mask[x] = '*') and GoodSoFar then
  304.         if mask[x] <> '?' then
  305.           if mask[x] <> name[x] then
  306.             GoodSoFar := false;
  307.     Matches := GoodSoFar;
  308.   end;  { NameMatches }
  309.  
  310. As I said - untested but I think it should work.
  311.  
  312. TeeCee
  313.  
  314.  
  315. --- TC-ED   v2.01  
  316.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  317.  * Tossed by SFToss v1.00b on 92/05/12  08:10:13
  318.  
  319. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  320.  
  321. Conference 4
  322. Date       05-11-92 18:13:41
  323. From       Trevor Carlsen
  324. To         Bill Long Nu-wave Softwar
  325. Subject    SHAREWARE DEALER
  326.  
  327.  
  328.  
  329.  BL> I RUN A BUSINESS CALLED NU-WAVE SOFTWARE LOACTED AT 1820 TALCO TERRACE 
  330.  
  331.  BL> DELTONA FL. 32738 THE PHONE NUMBERS ARE 904-xxx-xxxx OR 1-800-xxx-xxxx 
  332.  
  333.  BL> THE 800 NUMBER CAN BE USED FROM ANYWHERE I HAVE 230 PROGRAMS AVAILABLE
  334.  
  335. This echo permits limited "on-topic" low key advertising which would be of
  336. interest to echo readers world-wide.  This message does not qualify on these
  337. grounds.  Please do not post such a message again.
  338.  
  339. Trevor Carlsen
  340. Moderator.
  341.  
  342.  
  343. --- TC-ED   v2.01  
  344.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  345.  * Tossed by SFToss v1.00b on 92/05/12  08:10:13
  346.  
  347. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  348.  
  349. Conference 4
  350. Date       05-11-92 19:49:19
  351. From       Trevor Carlsen
  352. To         Basil Groman
  353. Subject    Features Lacking In Tp
  354.  
  355.  
  356.  
  357.  BG> If (TCLint) AND (TPascal) Then
  358.  BG>   If AvailableToPublic Then
  359.  BG>     AskWhenHow
  360.  BG>   Else
  361.  BG>     Ask_NeedBetaTesters
  362.  
  363. if (TCLint = Experimental) and (Results = NotYetUptoScratch) then
  364.   TCLint := Private
  365. else
  366.   TCWillAnnounce;
  367. { "UptoScratch" means of commercial or near commercial quality }
  368.  
  369. TeeCee
  370.  
  371. --- TC-ED   v2.01  
  372.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  373.  * Tossed by SFToss v1.00b on 92/05/12  08:10:13
  374.  
  375. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  376.  
  377. Conference 4
  378. Date       05-11-92 08:25:26
  379. From       Dj Murdoch
  380. To         Richard Morris
  381. Subject    Re: Turbovision - Off Topic?
  382.  
  383.   > Not a flat one, but I have code to read the PC Write
  384.  > dictionary of a few versions ago.
  385.  
  386.  RM> Mmmm, could be Interesting.  Is it your own?
  387.  
  388. I wrote the reader code, but released it to the public domain.  It was written
  389. in TP 3.01 to read the PCWrite 2.7 dictionary; I think it still works on current
  390. versions, but I could be wrong. 
  391.  
  392. The disadvantage of using this is that I believe the dictionary belongs to
  393. QuickSoft, so you won't be able to distribute it without licensing it, but
  394. it's pretty widely available to your users.
  395.  
  396. Here's the code.  I wrote it 5 years ago, and my style has improved since
  397. (I hope!), but I think it works.   The basic idea is this:  the PCWrite dictiona
  398. y is organized into blocks of 512 bytes.  There's an index giving the three
  399. letters starting each block; within each block, words are stored as incremental
  400. differences, with common characters stored in half a byte.
  401.  
  402. Good luck with it!
  403.  
  404.   type
  405.     dict_rec = array[0..511] of byte;
  406.     table_rec =
  407.       record
  408.         jump : byte;
  409.         letters : string[3];
  410.       end;
  411.   var
  412.     count,bufpos:integer; {mark current place in dict_buf}
  413.     b:byte;               {current byte from dict}
  414.     word:anystring;
  415.     len:integer;
  416.     dict_buf: dict_rec;
  417.     dict:file of dict_rec;
  418.     dict_size:integer;
  419.     table : array[0..255] of table_rec;
  420.  
  421.   function whichrec(testword:anystring):integer;
  422.   {  Finds which dictionary record to look in for testword  }
  423.   var
  424.     i:integer;
  425.   begin
  426.     i := dict_size - 1;
  427.     while (table[i].letters >= copy(testword,1,length(table[i].letters)))
  428.          and (i > 0) do
  429.       i := i-1;
  430.     whichrec := i;
  431.   end;
  432.  
  433.   procedure gotorec(recno:integer);
  434.   {  Reads dictionary record into buffer, and sets up bufpos & count  }
  435.   begin
  436.     seek(dict,recno);
  437.     read(dict,dict_buf);
  438.     with table[recno] do
  439.     begin
  440.       word := letters;
  441.       bufpos := jump shr 3;
  442.       if jump and 7 <> 0 then
  443.       begin
  444.         count := 1;
  445.         b := dict_buf[bufpos];
  446.         bufpos := bufpos+1;
  447.       end
  448.       else
  449.         count := 0;
  450.     end;
  451.   end; { procedure gotorec(recno:integer) }
  452.  
  453.   procedure init_dict;
  454.   {  Opens dictionary file, and sets up jump table in memory  }
  455.   var
  456.     i,j:integer;
  457.     temp:array[1..4] of char;
  458.     ok:boolean;
  459.   const
  460.     dictname:anystring = 'WORDS.MAS';
  461.   begin
  462.     repeat
  463.       assign(dict,dictname);
  464.       {$i-} reset(dict)  {$i+};
  465.       ok := (IOResult = 0);
  466.       if not ok then
  467.       begin
  468.         writeln('Dictionary not found.  Enter path to PC Write dictionary:');
  469.         if eof(input) then
  470.           halt;
  471.         readln(dictname);
  472.         clrscr;
  473.       end;
  474.     until ok;
  475.     read(dict,dict_buf);
  476.     dict_size := dict_buf[6] + dict_buf[7] shl 8;
  477.     seek(dict,dict_size);
  478.     read(dict,dict_buf);
  479.     temp[4] := #0;        { to stop Asciiz2s below }
  480.     i := 0;
  481.     j := 0;
  482.     while dict_buf[j] <> $ff do
  483.       with table[i] do
  484.       begin
  485.         jump := dict_buf[j];
  486.         move(dict_buf[j+1],temp,3);
  487.         letters := asciiz2s(temp);
  488.         i := i+1;
  489.         j := j+4;
  490.         if j > 511 then
  491.         begin
  492.           read(dict,dict_buf);
  493.           j := 0;
  494.         end;
  495.       end;
  496.   end;
  497.  
  498.   function getword:boolean;
  499.   {  function to build next word from dictionary, return true if successful  }
  500.  
  501.  
  502.   function getnibble:byte;
  503.   {  function to return next nibble from dictionary file  }
  504.   begin
  505.     if count = 0 then
  506.     begin
  507.       if bufpos > 511 then
  508.       begin
  509.         read(dict,dict_buf);
  510.         bufpos := 0;
  511.       end;
  512.       b := dict_buf[bufpos];
  513.       bufpos := bufpos+1;
  514.       count := 2;
  515.     end;
  516.     if count = 2 then
  517.       getnibble := b shr 4
  518.     else
  519.       getnibble := b and $0F;
  520.     count := count -1;
  521.   end;
  522.  
  523.   type
  524.     lettertable = array[0..$f] of char;
  525.   var
  526.     nibble:byte;
  527.     letter:char;
  528.     done :boolean;
  529.  
  530.   const                   {0   1   2   3   4   5   6   7}
  531.     table1:lettertable = ('a','c','d','e','g','i','l','m',
  532.                           'n','o','r','s','t','u',#1,#2);
  533.     table2:lettertable = ('`','b','f','h','j','k','p','q',
  534.                           'v','w','x','z','y',#3,'''',#4);
  535.                           {8   9   A   B   C   D   E   F}
  536.   begin
  537.     nibble:=getnibble;
  538.     if nibble = $0f then
  539.       getword := false
  540.     else
  541.     begin
  542.       delete(word,nibble+1,128);  { truncate word }
  543.       done := false;
  544.       repeat
  545.         letter := table1[getnibble];
  546.         if letter = #2 then
  547.           letter := table2[getnibble];
  548.         case letter of
  549.         #1:  begin
  550.                getword := true;
  551.                done := true;
  552.              end;
  553.         #3:  begin
  554.                getword := false;
  555.                done := true;
  556.              end;
  557.         #4:  word := word + char(getnibble shl 4 + getnibble)
  558.         else
  559.              word := word + letter;
  560.         end; { case letter }
  561.       until done;
  562.     end;
  563.   end;
  564.  
  565.  
  566. --- Msg V3.2
  567.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  568.  * Tossed by SFToss v1.00b on 92/05/12  14:37:03
  569.  
  570. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  571.  
  572. Conference 4
  573. Date       05-11-92 18:23:37
  574. From       Dj Murdoch
  575. To         Andrew Evers
  576. Subject    Re: Loading code at run-time
  577.  
  578.   AE> I have a program that I am working on which will produce 
  579.  AE> skeleton source code for playing PianoMan files and 
  580.  AE> Displaying TheDraw files. I would like to release it now 
  581.  AE> BUT there are other features I can add to it. I was 
  582.  AE> wondering if there was a way of linking code in at 
  583.  AE> run-time.  NOT overlays but source files compiled later or 
  584.  AE> by other people which could integrate themselves into the 
  585.  AE> program. 
  586.  
  587. There are several ways, but they're all messy.  The best solution is to use
  588. a DLL under Windows or OS/2.  One way under DOS is to compile the new code
  589. into an .EXE, shrink your TP heap, then load the new .EXE into high memory.
  590.  Finding entry points is messy, and there will always be problems in a high
  591. level language if you have two run-time libraries loaded.
  592.  
  593. You might want to take a look at my TPFORT18.ZIP package that does run-time
  594. linking of MS Fortran into TP.  It's pretty ugly, but does seem to work. 
  595. (You can get it from any PDN Pascal node, e.g. my bossnode, 1:221/177.  It's
  596. also available on the Internet from garbo.uwasa.fi in /pc/turbopas/tpfort18.zip.
  597.  
  598.  
  599.  AE>  I was also wondering if anyone has a .TPU -> .OBJ converter.
  600.  
  601. A .TPU is more like a .LIB than an .OBJ, but I don't know of a .TPU to .LIB
  602. convertor.  Borland half-heartedly produced a .TPU to .OBJ convertor for TP
  603. 4.0 so that you could use TP with Turbo Prolog, but has since dropped Prolog
  604. and never updated the convertor.
  605.  
  606. --- Msg V3.2
  607.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  608.  * Tossed by SFToss v1.00b on 92/05/12  14:37:03
  609.  
  610. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  611.  
  612. Conference 4
  613. Date       05-12-92 06:58:52
  614. From       Trevor Carlsen
  615. To         Richard Morris
  616. Subject    TSR Clock
  617.  
  618.  
  619.  
  620.  RM> TC>   IDStr : string[14] = $CF'TeeCee''s Clock';
  621.  RM>                             ^^^ IRET
  622.  
  623.  RM>  TC>     SetIntVec($66,@IDStr); { IDStr is obviously not an interrupt! 
  624.  
  625.  RM>      }
  626.  RM> 
  627.  RM> It is NOW! So if someone else uses int$66 (Didn't Turbo Powers mod's 
  628.  
  629.  RM> to TPC to int on pointer dereference use $66) they won't try to run 
  630.  RM> your nickname <grin>. I know you left in the gotcha's to point Damian 
  631.  
  632.  RM> towards a profesional toolbox, which he SHOULD use, but dangling an 
  633.  RM> interrupt like that really makes me feel uncomfortable <Brrrrr>.
  634.  
  635. I agree.  However the practice is not unique.  The video structure tables
  636. are pointed to in the same way.  I must have a look at them and see if the
  637. IRet is used there.  It is something I should have done.  ( I just looked
  638. - "Interrupts" $1d, $1e and $1f, are not interrupts and do not point to a
  639. structure that has IRet as the first byte.  Still that is a little different
  640. I guess - <sigh>.
  641.  
  642. BTW Adding the IRet *exactly* as you indicate, would not work.  The first
  643. byte being executed would still be the length byte.  So
  644.  
  645. const
  646.   IRet  : word = $cf;
  647.   IDStr : string[13]='TeeCee''s Clock';
  648. var
  649.   p : pointer;
  650. begin
  651.   GetIntVec($66,p);  { Int 66h is reserved for user defined interrupts }
  652.   inc(longint(p),2);
  653.   if string(p^) = IDStr then begin
  654.   ..
  655.   SetIntVec($66,@IRet); ...
  656. Another thing I discovered while double checking this (I wanted to be certain
  657. that the inc was incrementing the offset and not the segment :-)) was that
  658. the compiler regards pointers as an integer type.  Thus -
  659.   inc(p,2);
  660. will be accepted (and will work) and so will a
  661.   byte(p)
  662. typecast.
  663.  
  664.  
  665. TeeCee
  666.  
  667.  
  668. --- TC-ED   v2.01  
  669.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  670.  * Tossed by SFToss v1.00b on 92/05/12  20:41:35
  671.  
  672. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  673.  
  674. Conference 4
  675. Date       05-12-92 10:08:37
  676. From       Trevor Carlsen
  677. To         Mike Normand
  678. Subject    Over my head....
  679.  
  680.  
  681.  
  682.  TC> function Matches(name: str8; mask: str8): boolean;
  683.  TC>   var
  684.  TC>     x         : byte;
  685.  TC>     GoodSoFar : boolean;
  686.  TC>   begin
  687.  TC>     GoodSoFar := true;
  688.  TC>     for x := 1 to length(mask) do
  689.  TC>       if (mask[x] = '*') and GoodSoFar then
  690.  TC>         if mask[x] <> '?' then
  691.  TC>           if mask[x] <> name[x] then
  692.  TC>             GoodSoFar := false;
  693.  TC>     Matches := GoodSoFar;
  694.  TC>   end;  { NameMatches }
  695.  
  696.  TC> As I said - untested but I think it should work.
  697.  
  698. Gee... I'm glad I added that last line!!  Two changes would be needed to make
  699. this work properly, although it still would not be identical to the way DOS
  700. does things.  Here is the amended function -
  701.  
  702. function Matches(name: str8; mask: str8): boolean;
  703.   var
  704.     x         : byte;
  705.     GoodSoFar : boolean;
  706.   begin
  707.     GoodSoFar := true;
  708.     if (length(mask) = 0) and (length(name) <> 0) then
  709.       GoodSoFar := false
  710.     else
  711.       for x := 1 to length(mask) do
  712.         if (mask[x] <> '*') and GoodSoFar then
  713.           if mask[x] <> '?' then
  714.             if mask[x] <> name[x] then
  715.               GoodSoFar := false;
  716.     Matches := GoodSoFar;
  717.   end;  { Matches }
  718.  
  719. DOS does some strange things with wildcards -
  720.  
  721.   '*'     is the same as '*.*'
  722.   '?'     is the same as '?.*'
  723.   '?.'    is the same as '?.*'
  724.   't*'    will not find any file that has an extension
  725.   't?'    is the same as 't*'
  726.   't?.'   is the same as 't?.*'
  727.  
  728. (The above was tested using 4DOS running with DRDOS 6 so it may not be the
  729. same as MSDOS)
  730.  
  731.  
  732. TeeCee
  733.  
  734. --- TC-ED   v2.01  
  735.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  736.  * Tossed by SFToss v1.00b on 92/05/12  20:41:35
  737.  
  738. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  739.  
  740. Conference 4
  741. Date       05-12-92 08:04:17
  742. From       Dj Murdoch
  743. To         Rene Seguin
  744. Subject    Re: String Compression
  745.  
  746.  (RS isn't necessarily Rene Seguin!)
  747.  
  748.  RS>Does anybody know where I can get a fast (preferably assembly language)
  749.  RS>routine to compress text (ASCII < 127) strings & 
  750.  RS> decompress them, so that I
  751.  RS>can compress/decompress text arrays?  The PBCLONE 
  752.  RS> library in QBasic has one
  753.  RS>that uses the "2-gram" compression method - is there a similar method
  754.  RS>available in PASCAL (I use QuickPascal which is compatible with TP 5.0)
  755.  
  756.  RS>    There is a good implementation of LZW in the DJ Murdoch stream unit.
  757.  RS>    But the problem is that it uses TP6.0 OOP features... Maybe you could
  758.  RS>    "hack" on the little fast asm module to make it work on your system.
  759.  RS>    Look for stream11.zip.
  760.  
  761. The LZW code in the streams unit is a modified version of Wilbert van Leijen's
  762. TPLZW unit.  I think it should work in TP 4 and up.  The one problem with
  763. LZW encoding is that it tends to increase the size of small blocks.  If you
  764. need to compile each string separately, it wouldn't be a good choice.  
  765.  
  766. --- Msg V3.2
  767.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  768.  * Tossed by SFToss v1.00b on 92/05/13  10:18:49
  769.  
  770. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  771.  
  772. Conference 4
  773. Date       05-12-92 08:11:49
  774. From       Dj Murdoch
  775. To         Ryan Mullins
  776. Subject    Re: Does anyone?
  777.  
  778.   RM> Does anyone have the list of bugs in TP 6.0?  Just curious.
  779.  
  780. I sent it out on PDN Pascal as TP6BUGS6.ZIP, but I've got an idea something
  781. went wrong - I never saw the announcement that it had arrived.  If nobody
  782. has it, I'll send it again.
  783.  
  784. --- Msg V3.2
  785.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  786.  * Tossed by SFToss v1.00b on 92/05/13  10:18:49
  787.  
  788. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  789.  
  790. Conference 4
  791. Date       05-10-92 17:27:00
  792. From       Terry Hughes
  793. To         Tony Limbert
  794. Subject    Re: Looking for
  795.  
  796.  
  797. TL>Do you guys have a catalog on disk(Or a Disk File that can be printed up?)
  798. TL>?
  799.  
  800. Mmm, not really. Our BBS has a collection of text files
  801. describing our products but it's not something we've ever
  802. formalized into a catalog on disk. We do have complete
  803. brochures on all of our products that we could mail to you.
  804. The easiest way for you to get those would be to call our
  805. sales line: 800-333-4160.
  806.  
  807. -Terry
  808.  
  809.  * OLX 2.2 * TurboPower Software (voice 719-260-6641)
  810.  
  811. --- Maximus 2.01wb
  812.  * Origin: The Programmers Playhouse (1:128/60)
  813.  * Tossed by SFToss v1.00b on 92/05/14  08:55:04
  814.  
  815. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  816.  
  817. Conference 4
  818. Date       05-13-92 15:31:02
  819. From       Terry Hughes
  820. To         Herb Brown
  821. Subject    ems/xms/disk swap..
  822.  
  823.  
  824. HB>Hi!
  825.  
  826. HB>Terry, I found some code for EMS/XMS/Disk swapping in an
  827. HB>old issue of Doctor Dobbs Journel.  What I was wondering,
  828. HB>did you guys write this and is it ok to post it here?  The
  829. HB>source came from a cd-rom and states ya'll (southerner)
  830. HB>wrote it.  There was a few people looking for this kind of
  831. HB>code here..
  832.  
  833. If you're talking about the Doctor Dobbs article from 1989
  834. (May I think) then, yes, you can post that code pretty much
  835. wherever you like. I believe we retained a copyright on that
  836. particular code but we state that it may be freely
  837. distributed. If the article says otherwise then believe it
  838. rather than me.
  839.  
  840. I'm not 100% sure we're talking about the same article,
  841. though, since the one I'm thinking of addressed only
  842. EMS/disk swapping - no XMS at that time. If we've done
  843. another one since then it's news to me.
  844.  
  845. FWIW, that source code is availble on our BBS (and others
  846. as well, I guess) as EXECSWAP.LZH.
  847.  
  848. -Terry
  849.  
  850.  * OLX 2.2 * TurboPower Software (voice 719-260-6641)
  851.  
  852. --- Maximus 2.01wb
  853.  * Origin: The Programmers Playhouse (1:128/60)
  854.  * Tossed by SFToss v1.00b on 92/05/14  08:55:04
  855.  
  856. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  857.  
  858. Conference 4
  859. Date       05-13-92 08:02:17
  860. From       Dj Murdoch
  861. To         David G. Edwards
  862. Subject    Re: Procedures...
  863.  
  864.   DG> I think that exit procedures should be reserved for 
  865.  DG> system-type cleanup such as restoring interrupt vectors.  
  866.  DG> Closing files and other such "standard" stuff should be 
  867.  DG> done with regular proc's.  IMO, an exit proc should be as 
  868.  DG> short and "clean" as possible.
  869.  
  870. I don't understand this - why should exit procedures be special?  Do you think
  871. the same thing about unit initialization sections?  
  872.  
  873. I try to keep unit initialization sections small in a multi-purpose unit,
  874. because they make the linker pull in everything that they touch.  If you only
  875. want a small part of the unit, you may get the rest too, if you have a unit
  876. initialization.  (CRT is an extreme example of this.)
  877.  
  878. But exit procedures - there's no reason I can see that they shouldn't be as
  879. complicated as necessary to clean up after a unit.  I try to keep a single
  880. "owner" in mind for any resource used by a program, and make it the responsibili
  881. y of the owner to clean up the resource - close it if it's a file, dispose
  882. of it if it's allocated on the heap, restore the old value if it's an interrupt
  883. vector.  Resources used in the implementation section of a unit often belong
  884. to the unit, so the Exitproc cleans them up.
  885.  
  886. --- Msg V3.2
  887.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  888.  * Tossed by SFToss v1.00b on 92/05/14  11:26:43
  889.  
  890. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  891.  
  892. Conference 4
  893. Date       05-13-92 08:10:26
  894. From       Dj Murdoch
  895. To         Sean Ocker
  896. Subject    256 Colours from DOS (was: compression..
  897.  
  898.   SO> How do I get in 256 color(colour:humour) mode from a DOS prompt before
  899.  SO> entering any software.  I need to do this to view a certain graphics
  900.  SO> file I have.
  901.  
  902. I've got no idea - shouldn't the viewer program set the graphics mode?  Most
  903. 256 colour modes aren't standard (only 320x200 is on a standard VGA, I think)
  904. so DOS doesn't really know about them.  You could run a little TP program
  905. that set the graphics mode and didn't restore the old one when done, but you
  906. might find that your BIOS doesn't support text in the 256 colour mode, and
  907. you'd be out of luck.
  908.  
  909. --- Msg V3.2
  910.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  911.  * Tossed by SFToss v1.00b on 92/05/14  11:26:43
  912.  
  913. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  914.  
  915. Conference 4
  916. Date       05-13-92 08:24:24
  917. From       Dj Murdoch
  918. To         Trevor Carlsen
  919. Subject    Re: Over my head....
  920.  
  921.   TC>   begin
  922.  TC>     GoodSoFar := true;
  923.  TC>     if (length(mask) = 0) and (length(name) <> 0) then
  924.  TC>       GoodSoFar := false
  925.  TC>     else
  926.  TC>       for x := 1 to length(mask) do
  927.  TC>         if (mask[x] <> '*') and GoodSoFar then
  928.  TC>           if mask[x] <> '?' then
  929.  TC>             if mask[x] <> name[x] then
  930.  TC>               GoodSoFar := false;
  931.  TC>     Matches := GoodSoFar;
  932.  TC>   end;  { Matches }
  933.  
  934. Won't this version still have trouble with embedded asterisks?  E.g. if mask='*.
  935. as', it looks as though it won't match "test.pas".  Or did you do something
  936. to the mask so that's not possible?
  937.  
  938.  TC> DOS does some strange things with wildcards -
  939.  
  940. Different parts of DOS do different strange things.  For example, DIR * lists
  941. everything, but ERASE * only erases the files with no extension.
  942.  
  943.  TC>   '?.'    is the same as '?.*'
  944.  TC>   't*'    will not find any file that has an extension
  945.  TC>   't?'    is the same as 't*'
  946.  TC>   't?.'   is the same as 't?.*'
  947.  
  948. These four don't behave that way under DIR in MSDOS 5.  DIR treats them as:
  949.  
  950.   '?.' is '?       .   '
  951.   't*' is 't???????.???'
  952.   't?' is 't?      .???'
  953.   't?.'is 't?      .   '
  954.  
  955. The rule seems to be that a missing "." is equivalent to adding ".???" on
  956. the end.  For ERASE, the rule looks like a missing "." is like adding a blank
  957. extension.  I haven't tried Findfirst/Findnext here.
  958.  
  959.  TC> (The above was tested using 4DOS running with DRDOS 6 so 
  960.  TC> it may not be the same as MSDOS)
  961.  
  962.  
  963. --- Msg V3.2
  964.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  965.  * Tossed by SFToss v1.00b on 92/05/14  11:26:43
  966.  
  967. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  968.  
  969. Conference 4
  970. Date       05-13-92 08:35:44
  971. From       Dj Murdoch
  972. To         Craig Leikis
  973. Subject    Re: PASCAL STYLE #2
  974.  
  975.   CL> Execution speed and code size is not affected by style of 
  976.  CL> programming, it's still the same command. This, of course, 
  977.  CL> is in most cases. The only thing is really may effect is 
  978.  CL> source code size..
  979.  
  980. But the example choice was
  981.  
  982.   x := 1;
  983.   if y > 10 then
  984.     x := 2;
  985.  
  986. versus
  987.   
  988.  if y > 10 then
  989.    x := 2
  990.  else
  991.    x := 1;
  992.  
  993. These do have different code sizes.  The second one is 2 bytes longer (21
  994. bytes versus 19 bytes).  They take about the same time to execute:  the first
  995. one sometimes wastes an assignment, but the second one always executes a jump.
  996.  
  997. The differences are trivial in this example, but might make a difference in
  998. a big program, or in a critical loop.  Still, I generally prefer the second
  999. (inefficient) choice for readability. 
  1000.  
  1001.  
  1002. --- Msg V3.2
  1003.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1004.  * Tossed by SFToss v1.00b on 92/05/14  11:26:43
  1005.  
  1006. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1007.  
  1008. Conference 4
  1009. Date       05-12-92 22:39:57
  1010. From       Mark Ouellet
  1011. To         Eric Schreiber
  1012. Subject    Re: TP 6.0
  1013.  
  1014.  
  1015.     On 06 May 92, you, Eric Schreiber, of 1:115/858.0 wrote...
  1016.  
  1017.  MO>> Does it have a TVision section?? If so how long and
  1018.  MO>> how good ??
  1019.  
  1020.  ES> I have 2 pascal 6.0 books that I recommend highly:
  1021.  ES> 
  1022.  ES> The first is Turbo Pascal 6.0 Techniques and Utilities, published by 
  1023.  
  1024.  ES> Ziff-Davis
  1025.  
  1026.         Thanks Eric, I allready got that one after all the
  1027. talk about it.
  1028.  
  1029.  ES> The second book is Clean Coding in Turbo Pascal 6, published by M&T 
  1030.  ES> books, and
  1031.  ES> written by Amrik Dhillon, who, I gather, works for Borlands' tech 
  1032.  ES> support
  1033.  ES> group...   This book is 2/3 TV related, has very specific, simple, and 
  1034.  
  1035.  ES> well-
  1036.  ES> documented examples, and includes a disk w/ all source.  THe last 1/3 of 
  1037.  
  1038.  ES> the
  1039.  ES> book relates to TP fr Windows programming, but is worth the purchase 
  1040.  
  1041.  ES> price
  1042.  ES> ($37, egads!) even if you don't plan on using TPW...
  1043.  ES> 
  1044.  ES> I hope this is of some assistance...
  1045.  
  1046. Sure is Eric,
  1047.         2/3 of a book on TV is, to say the least, very
  1048. interresting.
  1049.  
  1050.         Best regards,
  1051.         Mark Ouellet.
  1052.  
  1053.  
  1054.  
  1055. --- ME2
  1056.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  1057.  * Tossed by SFToss v1.00b on 92/05/14  11:26:49
  1058.  
  1059. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1060.  
  1061. Conference 4
  1062. Date       05-12-92 22:50:02
  1063. From       Mark Ouellet
  1064. To         Andrew Krywaniuk
  1065. Subject    Re: TP6 Variable errors
  1066.  
  1067.  
  1068.     On 06 May 92, you, Andrew Krywaniuk, of 1:153/949.0 wrote...
  1069.  
  1070.  AK> I'm pretty new to Turbo pascal, so I'm sure that everyone else out there 
  1071.  
  1072.  AK> knows how to do this:
  1073.  AK> 
  1074.  AK> When I set a variable as an integer, and the person using my program is 
  1075.  
  1076.  AK> kind of stupid -(I ask: 'How many years old are you?', and they type: 
  1077.  
  1078.  AK> 'sixteen')- how can I avoid the inevitable break in the program, and 
  1079.  
  1080.  AK> replace it with my own 'please enter that on the numeric keypad, 
  1081.  AK> lesserlife' type message? It must be possible because those commercial 
  1082.  
  1083.  AK> programs written in pascal don't abort just because someone can't answer 
  1084.  
  1085.  AK> a simple question.  
  1086.  
  1087. Andrew,
  1088.         The answer of course is to get input into a STRING
  1089. variable and convert it to numeric via the VAL() procedure.
  1090. That is how I did it in the old days (TP 3.x) and it is the
  1091. best way to avoid your program crashing because they entered
  1092. 16.5 instead of an integer.
  1093.  
  1094.         Best regards,
  1095.         Mark Ouellet.
  1096.  
  1097.  
  1098.  
  1099. --- ME2
  1100.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  1101.  * Tossed by SFToss v1.00b on 92/05/14  11:26:49
  1102.  
  1103. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1104.  
  1105. Conference 4
  1106. Date       05-12-92 23:04:51
  1107. From       Mark Ouellet
  1108. To         Derek Mahar
  1109. Subject    Re: GetPixel
  1110.  
  1111.  
  1112.     On 08 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
  1113.  
  1114.  DM> In a message on <May 05 23:51>, Gerald Gutierrez (1:153/715.5Derekidonet) 
  1115.  
  1116.  DM> writes:
  1117.  DM> 
  1118.  GG>> Could not find the original question, but assuming that someone 
  1119.  GG>> is looking for the getpixel function in mode 13h:
  1120.  
  1121.  GG>> Function  Z_GetPixel ( X,Y : Word ): Byte;
  1122.  GG>> Assembler;
  1123.  
  1124.  GG>>   asm
  1125.  GG>>      mov ax,0a000h
  1126.  GG>>      mov es,ax
  1127.  GG>>      mov di,x
  1128.  GG>>      mov ax,y
  1129.  GG>>      xchg ah,al          { multiply Y by 320 }
  1130.  GG>>      add di,ax
  1131.  GG>>      shr ax,1
  1132.  GG>>      shr ax,1
  1133.  GG>>      add di,ax
  1134.  GG>>      lodsb
  1135.  GG>>   end;
  1136.  
  1137.  DM> Why does an xchg ah,al multiply y by 320?  This is the same as rol ax,8 
  1138.  
  1139.  DM> which multiplies ax by 256.  Could you comment on each line of this code 
  1140.  
  1141.  DM> for me?
  1142.  
  1143. Derek,
  1144.         Exchanging al with ah multiplies AX * 256 which is
  1145. put into DI, the (AX*256) is shifted right twice which makes
  1146. it (AX*64) and (Ax*64) + (AX*256) = AX * (64+256) = AX *
  1147. 320.
  1148.  
  1149.         Best regards,
  1150.         Mark Ouellet.
  1151.  
  1152.  
  1153.  
  1154. --- ME2
  1155.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  1156.  * Tossed by SFToss v1.00b on 92/05/14  11:26:49
  1157.  
  1158. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1159.  
  1160. Conference 4
  1161. Date       05-12-92 23:17:36
  1162. From       Mark Ouellet
  1163. To         Derek Mahar
  1164. Subject    Re: Multiuser databases
  1165.  
  1166.  
  1167.     On 07 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
  1168.  
  1169.  DM> Doesn't Netware provide a means of passing messages directly between 
  1170.  
  1171.  DM> terminals?  Are there any inter-node chat applications available?  Just 
  1172.  
  1173.  DM> a few ideas I thought I would pass back at you.  I would be interested 
  1174.  
  1175.  DM> in knowing the answers to these questions myself.
  1176.  
  1177. Derek,
  1178.         Take a look at.... OOPS MEMORY LAPS.. what's that
  1179. darn flying horse's name..Oh yeah, PEGASUS, full E-Mail
  1180. system for NetWare with file enclosure etc... and it's
  1181. free-ware.
  1182.  
  1183.         Best regards,
  1184.         Mark Ouellet.
  1185.  
  1186.  
  1187.  
  1188. --- ME2
  1189.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  1190.  * Tossed by SFToss v1.00b on 92/05/14  11:26:50
  1191.  
  1192. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1193.  
  1194. Conference 4
  1195. Date       05-12-92 23:25:43
  1196. From       Mark Ouellet
  1197. To         Jason Davies
  1198. Subject    Re: TSR
  1199.  
  1200.  
  1201.     On 08 May 92, you, Jason Davies, of 1:340/203.0 wrote...
  1202.  
  1203.  JD> I'm fooling around with TSR's and have met a problem. when it closes a 
  1204.  
  1205.  JD> file I get an run time error #6. Anybody know what I'm doing wrong?
  1206.  JD> thank you
  1207.  
  1208. Jason,
  1209.         Well since error #6 is "Bad file handle" I suspect
  1210. you open the file during initialisation of the TSR and the
  1211. error occurs when you try to close it. Normally when a
  1212. program terminates ALL it's file handles are closed by DOS
  1213. thus the error. File handling in TSR's is a problem for this
  1214. reason, when you KEEP the process it is really terminated
  1215. and thus all it's open handles are closed. Can't help you
  1216. more than this, hope it's enough to get you on the right
  1217. track.
  1218.  
  1219.         Best regards,
  1220.         Mark Ouellet.
  1221.  
  1222.  
  1223.  
  1224. --- ME2
  1225.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  1226.  * Tossed by SFToss v1.00b on 92/05/14  11:26:50
  1227.  
  1228. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1229.  
  1230. Conference 4
  1231. Date       05-13-92 06:13:30
  1232. From       Trevor Carlsen
  1233. To         Kim Heaver
  1234. Subject    Scrolling a text window
  1235.  
  1236.  
  1237.  
  1238.  KH> How do you scroll the contents of a text window.
  1239.  KH> I can see how to create it and write text to it but if I want to
  1240.  KH> page up and down, how do i do it.
  1241.  
  1242. initialise starting line number to lowest value allowed.
  1243. Place each screen line into an array.
  1244. repeat
  1245.   Display the number of lines your window holds.
  1246.   Get and check a keypress
  1247.   If page up decrement the starting line number by number of screen lines
  1248. if   possible.
  1249.   If page down increment the strating line number by number of screen lines
  1250. if   possible.
  1251. until the keypressed indicates exit is requested.
  1252.  
  1253. I've netmailed you a copy of a simple file viewer I wrote.  If you study that
  1254. code it might help a little.
  1255.  
  1256. TeeCee
  1257.  
  1258. --- TC-ED   v2.01  
  1259.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1260.  * Tossed by SFToss v1.00b on 92/05/14  19:43:36
  1261.  
  1262. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1263.  
  1264. Conference 4
  1265. Date       05-13-92 06:45:04
  1266. From       Trevor Carlsen
  1267. To         Robert Johnston
  1268. Subject    Quick Question
  1269.  
  1270.  
  1271.  
  1272.  RJ> Turbo Pascal  Version 6.0  Copyright (c) 1983,90 Borland International
  1273.  RJ> RACRT.PAS(435)
  1274.  RJ> RADOOR.PAS(1038)
  1275.  RJ> NUKEWARS.PAS(1249)
  1276.  RJ> REG.PAS(57)
  1277.  RJ> NUKE.PAS(3211): Error 48: Code segment too large.
  1278.  RJ> end;
  1279.  RJ> ^
  1280.  
  1281.  RJ>    (NUKE.PAS) to the .OVR file (NUKEWARS.PAS Via {$O NUKEWARS}) 
  1282.  RJ> because
  1283.  RJ>    all of them interface in some way with USER_ARRAY (which is the 
  1284.  RJ> array
  1285.  RJ>    that I read all of the user data into at the beginning)...
  1286.  
  1287. All that means is that the amount of your global data exceeds the allowable
  1288. limit (64K).  The fix is simple.  Move your biggest structures into the heap.
  1289.  
  1290. BTW - You are using hi-bit characters in your signature, please remove as
  1291. these are not permitted in FidoNet echos.
  1292.  
  1293. TeeCee
  1294.  
  1295. --- TC-ED   v2.01  
  1296.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1297.  * Tossed by SFToss v1.00b on 92/05/14  19:43:36
  1298.  
  1299. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1300.  
  1301. Conference 4
  1302. Date       05-13-92 19:00:15
  1303. From       Trevor Carlsen
  1304. To         Matt Heck
  1305. Subject    The function "pos"
  1306.  
  1307.  
  1308.  
  1309.  MH> Function UpString(Mixed : string) : string;
  1310.  MH> var L    : byte;
  1311.  MH>     Temp : string;
  1312.  MH> begin
  1313.  MH>  Temp:='';
  1314.  MH>  For L:=1 to Length(Mixed) do Temp:=Temp+UpCase(Mixed[L])
  1315.  MH> end;
  1316.  
  1317. Matt, apart from the fact that you have omitted to assign a value to the functio
  1318. , there's nothing wrong with this except that it is very, very slow.  Using
  1319. concatenation in this way is something that should be avoided at all costs.
  1320.  
  1321. Here is an alternative that is 577% faster than the above and is very much
  1322. more economical in stack usage.
  1323.  
  1324. function UpString(Mixed: string): string;
  1325.   var L : byte;
  1326.   begin
  1327.     UpString[0] := Mixed[0];
  1328.     for L := 1 to length(Mixed) do
  1329.       UpString[L] := UpCase(Mixed[L]);
  1330.   end;
  1331.  
  1332.  
  1333. TeeCee
  1334.  
  1335. --- TC-ED   v2.01  
  1336.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1337.  * Tossed by SFToss v1.00b on 92/05/14  19:43:36
  1338.  
  1339. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1340.  
  1341. Conference 4
  1342. Date       05-14-92 02:18:35
  1343. From       Trevor Carlsen
  1344. To         Jud Mccranie
  1345. Subject    Pascal Style #2
  1346.  
  1347.  
  1348.  
  1349.  JM> Here is something else on which I'd like to hear people's opinion.
  1350.  JM> Which is better Pascal style:
  1351.  
  1352.  JM> x := 1;
  1353.  JM> if y > 10 then x := 2;
  1354.  
  1355.  JM> or
  1356.  
  1357.  JM>if y > 10
  1358.  JM>  then x := 2
  1359.  JM>  else x := 1;
  1360.  
  1361.  JM> I'm more concerned with the programmer-level reasons, rather than
  1362.  JM> execution speed or code size.
  1363.  
  1364. I would normally choose the second method, although there are occasions when
  1365. a third method is preferable.
  1366.  
  1367.   x := succ(ord(y > 10));
  1368.  
  1369. TeeCee
  1370.  
  1371. --- TC-ED   v2.01  
  1372.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1373.  * Tossed by SFToss v1.00b on 92/05/14  19:43:36
  1374.  
  1375. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1376.  
  1377. Conference 4
  1378. Date       05-14-92 03:17:27
  1379. From       Trevor Carlsen
  1380. To         Joy Mukherjee
  1381. Subject    Unix Style timestamp 
  1382.  
  1383.  
  1384.  
  1385.  JM> Function GetTimeZone : ShortInt;
  1386.  JM> {}
  1387.  JM> Var
  1388.  JM>   Environment : String;
  1389.  JM>   Index : Integer;
  1390.  
  1391.  JM> Begin
  1392.  JM>   GetTimeZone := 0;                            {Assume UTC}
  1393.  JM>   Environment := GetEnv('TZ');       {Grab TZ string}
  1394.  JM>   For Index := 1 To Length(Environment) Do
  1395.  JM>     Environment[Index] := Upcase(Environment[Index]);
  1396.  JM>   If Environment =  'EST05'    Then GetTimeZone := -05; {USA EASTERN}
  1397.  JM>   If Environment =  'EST05EDT' Then GetTimeZone := -06;
  1398.  JM>   If Environment =  'CST06'    Then GetTimeZone := -06; {USA CENTRAL}
  1399.  JM>   If Environment =  'CST06CDT' Then GetTimeZone := -07;
  1400.  JM>   If Environment =  'MST07'    Then GetTimeZone := -07; {USA MOUNTAIN}
  1401.  JM>   If Environment =  'MST07MDT' Then GetTimeZone := -08;
  1402.  JM>   If Environment =  'PST08'    Then GetTimeZone := -08;
  1403.  JM>   If Environment =  'PST08PDT' Then GetTimeZone := -09;
  1404.  JM>   If Environment =  'YST09'    Then GetTimeZone := -09;
  1405.  JM>   If Environment =  'AST10'    Then GetTimeZone := -10;
  1406.  JM>   If Environment =  'BST11'    Then GetTimeZone := -11;
  1407.  JM>   If Environment =  'CET-1'    Then GetTimeZone :=  01;
  1408.  JM>   If Environment =  'CET-01'   Then GetTimeZone :=  01;
  1409.  JM>   If Environment =  'EST-10'   Then GetTimeZone :=  10;
  1410.  JM>   If Environment =  'WST-8'    Then GetTimeZone :=  08; {Perth, 
  1411.  JM> Western Austrail
  1412.  JM>   If Environment =  'WST-08'   Then GetTimeZone :=  08;
  1413.  JM> End; 
  1414.  
  1415. I know that this code is not yours Joy, but code such as this makes me shudder!
  1416. The least that should be done is to prevent redundant checks by using an "else
  1417. if" rather than just "if" for every line after the first "if". That simple
  1418. change would significantly speed it up.
  1419.  
  1420. Better yet (IMHO) is:
  1421.  
  1422. function GetTimeZone: ShortInt;
  1423.   const
  1424.     NumberOfZones        = 16;
  1425.     TimeZoneStr : string =
  1426.       '        '+
  1427.       'EST05   EST05EDTCST06   CST06CDTMST07   MST07MDTPST08   PST08PDT'+
  1428.       'YST09   AST10   BST11   CET-1   CET-01  EST-10  WST-8   WST-08  ';
  1429.     TimeZoneVal : array[0..16] of ShortInt =
  1430.                   (0,-5,-6,-6,-7,-7,-8,-8,-9,-9,10,-11,1,1,10,8,8);
  1431.   var
  1432.     Environment : string;
  1433.   begin
  1434.     Environment := GetEnv('TZ');
  1435.     StrUpr(Environment);  { from Eagle's strg unit }
  1436.     GetTimeZone := TimeZoneVal [pos(Environment,TimeZoneStr) div 8];
  1437.   end;  { GetTimeZone }
  1438.  
  1439. TeeCee
  1440.  
  1441. --- TC-ED   v2.01  
  1442.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1443.  * Tossed by SFToss v1.00b on 92/05/14  19:43:36
  1444.  
  1445. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1446.  
  1447. Conference 4
  1448. Date       05-14-92 10:39:56
  1449. From       Trevor Carlsen
  1450. To         Greg Belanger
  1451. Subject    Re: Encryption of sorts.
  1452.  
  1453.  
  1454.  
  1455.  GB> I'm lookin for a way to Encrypt various aspects of my
  1456.  GB> programs. For example, I know it's quite easy to use a HEX
  1457.  GB> editor and go in and edit the program name, autor and
  1458.  GB> copyright info.  Is there a way to make this "text"
  1459.  GB> unmodifiable?  I'm looking for a nice, simple routine..not
  1460.  GB> 400 lines of encryption code.  Any suggestions?
  1461.  
  1462. Greg, here is how I do it now.  This is not foolproof by any means, but in
  1463. order to defeat this it would require many hours of tedious disassembly and
  1464. analysis.  It requires the use of my unit - endecode - which I will post in
  1465.  a separate message.
  1466.  
  1467. Basically, before compiling your program make up your copyright notice and
  1468. set an encryption key and then run this program.  The program you wish to
  1469. protect must then include the resulting file "copyrite.inc" in a const declarati
  1470. n section of your program and you can then do a check for tampering if you
  1471. wish. It is for this reason that I like to also include a plain text version
  1472. of the copyright notice as this is what an illegal hacker would first go to.
  1473.  
  1474. One of the good things about this method is that it does not use typed constants
  1475. and it therefore places the coded copyright notice and the key in the code
  1476. segment rather than in the data segment, thus complicating the disassembly
  1477. and analysis still further.
  1478.  
  1479. uses
  1480.   endecode;
  1481. const
  1482.   hash   = '#';
  1483.   fname  = 'COPYRITE.INC';
  1484.   notice : string = 
  1485.            'Copyright 1991,1992 Trevor J Carlsen - All rights reserved';
  1486.   keyval = 1234567890; { This can be whatever longint value you choose }
  1487. var
  1488.   f      : text;
  1489.   CodeStr: string;
  1490.   x      : word;
  1491.  
  1492. begin
  1493.   CodeStr := EncryptStr(keyval,notice);
  1494.   notice := '  notice  = '#39+notice+#39#59;
  1495.   assign(f,fname);
  1496.   rewrite(f);
  1497.   writeln(f,'const');
  1498.   writeln(f,notice); { creates the plain text version constant }
  1499.   writeln(f,'  CodeStr = ');
  1500.   write(f,'  ');
  1501.   for x := 1 to length(CodeStr) do begin
  1502.     if x mod 20 = 0 then begin
  1503.       writeln(f,'+');
  1504.       write(f,'  ');
  1505.     end;
  1506.     write(f,'#',ord(CodeStr[x]));
  1507.   end;
  1508.   writeln(f,';');
  1509.   writeln(f,'  keyval  = ',keyval,#59);
  1510.   writeln(f);
  1511.   close(f);
  1512. end.
  1513.  
  1514. Here is an example of the output of the above code -
  1515.  
  1516. const
  1517.   notice  = 'Copyright 1991,1992 Trevor J Carlsen - All rights reserved';
  1518.   CodeStr = 
  1519.   #155#155#83#152#151#154#148#88#36#77#87#73#119#80#70#143#142#79#101+
  1520.   #86#130#52#64#79#49#42#156#119#153#41#69#147#58#148#33#67#147#138#137+
  1521.   #129#43#46#112#38#36#149#37#140#69#117#33#44#60#135#135#65#37#94;
  1522.   keyval  = 1234567890;
  1523.  
  1524. And an example of a "protected" program -
  1525.  
  1526. uses
  1527.   endecode;
  1528.  
  1529. {$I P:\PROG\COPYRITE.INC }
  1530.  
  1531. begin
  1532.   if DecryptStr(keyval,CodeStr) <> notice then
  1533.     writeln('Copyright notice has been tampered with...')
  1534.   else
  1535.     writeln('Copyright notice integrity is Ok');
  1536. end.
  1537.  
  1538. Unit endecode in the next message.
  1539.  
  1540. TeeCee
  1541.  
  1542.  
  1543. --- TC-ED   v2.01  
  1544.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1545.  * Tossed by SFToss v1.00b on 92/05/14  19:43:36
  1546.  
  1547. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1548.  
  1549. Conference 4
  1550. Date       05-14-92 10:40:04
  1551. From       Trevor Carlsen
  1552. To         Greg Belanger
  1553. Subject    Re: Encryption of sorts.
  1554.  
  1555.  
  1556.  
  1557. Here is the endecode unit.
  1558.  
  1559. UNIT Endecode;
  1560.  { Simple encryption/decryption routines.                    }
  1561.  { Author: Trevor J Carlsen. Released into the public domain.}
  1562.  
  1563. interface 
  1564.  
  1565. type
  1566.   starray = array[0..255] of byte;
  1567.  
  1568. function Key(var s): longint;
  1569. function EncryptStr(key : longint; s: string): string;
  1570. function DecryptStr(key : longint; s: string): string;
  1571.  
  1572. implementation
  1573.  
  1574. function MakeCodeStr(key : longint; s: string): string;
  1575.   { Creates a "randomly" constructed string of a similar   }
  1576.   { length as the string which is to be encrypted. A       }
  1577.   { longint key is used to permit "password" type          }
  1578.   { encryption. This key may be passed as a literal or     }
  1579.   { some password used to calculate it. Using this key,    }
  1580.   { the last character of the string to be encrypted and   }
  1581.   { the length of the string, a "code string" is produced. }
  1582.   { This code string is then XORd with the original string }
  1583.   { to produce the encrypted string. The last character    }
  1584.   { however must be treated differently so that it can be  }
  1585.   { easily decoded in order to reproduce the coded string  }
  1586.   { used for decoding. This is done by XORing it with the  }
  1587.   { length of the string. To decrypt a string the last     }
  1588.   { character must be decoded first and then the key coded }
  1589.   { string produced in order to decrypt each character.    }
  1590.  
  1591.   var
  1592.     x   : word;
  1593.     len : byte absolute s;
  1594.     st  : array[0..255] of byte absolute s;
  1595.  
  1596.   begin
  1597.     RandSeed := (key * len) DIV st[len];
  1598.     {This ensures that no two code strings will be similar UNLESS they are
  1599.      of identical length, have identical last characters and the same
  1600.      key is used.}
  1601.     MakeCodeStr[0] := chr(len);
  1602.     for x := 1 to len do
  1603.       MakeCodeStr[x] := chr(32 + Random(95));
  1604.       {Keeping the character between 32 and 127 ensures that the high bit
  1605.        is never set on the original encrypted character and therefore allows
  1606.        this to be used as flag to indicate that the coded char was < #32.
  1607.        This will then permit the encrypted string to be printed without fear
  1608.        of having embedded control codes play havoc with the printer.}
  1609.   end;
  1610.  
  1611. function Key(var st): longint;
  1612.   { Creates a key for seeding the random number generator. st can be a
  1613.     password }
  1614.   var
  1615.     x     : byte;
  1616.     temp  : longint;
  1617.     c     : array[1..64] of longint absolute s;
  1618.     len   : byte absolute s;
  1619.   begin
  1620.     temp  := 0;
  1621.     for x := 1 to len div 4 do
  1622.       temp := temp xor c[x];
  1623.     Key := Abs(temp);
  1624.   end;
  1625.  
  1626. function EncryptStr(key : longint; s: string): string;
  1627.   var
  1628.     cnt,x          : byte;
  1629.     len            : byte absolute s;
  1630.     st             : array[0..255] of byte absolute s;
  1631.     CodeStr        : starray;
  1632.     temp           : string absolute CodeStr;
  1633.   begin
  1634.     temp           := MakeCodeStr(key,st);
  1635.     EncryptStr[0]  := chr(len);
  1636.     EncryptStr[len]:= chr(st[len]);
  1637.     for x := 1 to len-1 do begin
  1638.       cnt := st[x] xor CodeStr[x];
  1639.       inc(cnt,128 * ord(cnt < 32));
  1640.       EncryptStr[x]:= chr(cnt);
  1641.     end;  { for }
  1642.     cnt := st[len] xor (len and 127);
  1643.     inc(cnt,128 * ord(cnt < 32));
  1644.     EncryptStr[len]:= chr(cnt);
  1645.   end;
  1646.  
  1647. function DecryptStr(key : longint; s: string): string;
  1648.   var
  1649.     cnt,x        : byte;
  1650.     st           : starray absolute s;
  1651.     len          : byte absolute s;
  1652.     CodeStr      : starray;
  1653.     temp         : string absolute CodeStr;
  1654.     ch           : char;
  1655.   begin
  1656.     cnt          := st[len] and 127;
  1657.     st[len]      := cnt xor len;
  1658.     temp         := MakeCodeStr(key,st);
  1659.     DecryptStr[0]:= chr(len);
  1660.     DecryptStr[len]:= chr(st[len]);
  1661.     for x := 1 to len-1 do begin
  1662.       cnt        := st[x];
  1663.       dec(cnt,128 * ord(st[x] > 127));
  1664.       DecryptStr[x] := chr(cnt xor CodeStr[x]);
  1665.     end;  { for }
  1666.   end;
  1667.  
  1668. end.
  1669.  
  1670. TeeCee
  1671.  
  1672.  
  1673. --- TC-ED   v2.01  
  1674.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1675.  * Tossed by SFToss v1.00b on 92/05/14  19:43:37
  1676.  
  1677. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1678.  
  1679. Conference 4
  1680. Date       05-14-92 11:56:07
  1681. From       Trevor Carlsen
  1682. To         Robert Johnston
  1683. Subject    Quick Question
  1684.  
  1685.  
  1686.  
  1687.  RJ> NUKE.PAS(3211): Error 48: Code segment too large.
  1688.  
  1689. I was just about to delete this message and noticed that my reply to you was
  1690. incorrect and want to correct it before I get 50,000 messages pointing out
  1691. my error <grin>.
  1692.  
  1693. The nuke unit is too big and will require that you break it down into two
  1694. or more units.  This should be an easy task with a unit of that size.  The
  1695. way to solve the way that it refers to a big array is just put that array
  1696. into a unit of its own and have any unit that refers to that array use that unit.
  1697.  
  1698.  
  1699. Sorry about the erroneous "fix" suggestion.
  1700.  
  1701. TeeCee
  1702.  
  1703.  
  1704.  
  1705. --- TC-ED   v2.01  
  1706.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1707.  * Tossed by SFToss v1.00b on 92/05/14  19:43:37
  1708.  
  1709. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1710.  
  1711. Conference 4
  1712. Date       05-14-92 08:08:00
  1713. From       Dj Murdoch
  1714. To         BRIAN PAPE
  1715. Subject    Re: TP 6.0 BUG LIST (RELE
  1716.  
  1717.   BP> I'm *not* trying to bash Borland...  I have so many Borland products (TP
  1718.  BP> 4.0,5.0,5.5,6.0,TPW), TC++,Paradox 1.0,2.0, Quattro 1.0,2.0,3.0, etc.
  1719.  BP> etc.) that I obviously like their products...  Microsloth on the other
  1720.  BP> hand...
  1721.  
  1722. No problem.  
  1723.  
  1724. On another topic: do you know why your replies always shorten the subject
  1725. line?  They also map it to upper case.  It really messes up my reader, which
  1726. tries to put threads together based on matching the subject; yours never match.
  1727.  If you could tell me the rule your software uses, I might be able to add
  1728. it as an exception. 
  1729.  
  1730. Oh, just thought of something.  Are you manually retyping the subject?  If
  1731. so, I can't really blame you for shortening it a bit, but I'd recommend finding
  1732. a reader that can do it for you automatically.
  1733.  
  1734. --- Msg V3.2
  1735.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1736.  * Tossed by SFToss v1.00b on 92/05/15  08:22:58
  1737.  
  1738. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1739.  
  1740. Conference 4
  1741. Date       05-14-92 08:18:21
  1742. From       Dj Murdoch
  1743. To         Max Maischein
  1744. Subject    Re: Inlines.INC
  1745.  
  1746.   MM> Yup, Inlines.INC is my include file for those fast 
  1747.  MM> inline-code, that is inserted directly into the code for 
  1748.  MM> speed reasons. I suspect that it is mainly the same as the 
  1749.  MM> OPInline contents...
  1750.  
  1751. Does it just include inline procedures, or others, too?  It makes no difference
  1752. to an inline procedure whether it's in the same unit or not.
  1753.  
  1754. --- Msg V3.2
  1755.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1756.  * Tossed by SFToss v1.00b on 92/05/15  08:22:58
  1757.  
  1758. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1759.  
  1760. Conference 4
  1761. Date       05-14-92 08:19:34
  1762. From       Dj Murdoch
  1763. To         Max Maischein
  1764. Subject    Re: Turbovision - Off Topic? / Message r
  1765.  
  1766.   >> This thing is called the TeX-algorithm, I think.
  1767.  >> Interested ?
  1768.  
  1769.  > Mmmm, Yes Max it sounds interesting, is the algorithm in the
  1770.  > public domain?
  1771.  
  1772.  MM> Nope. It is out of the famous german computer magazine c't,
  1773.  MM> number 1992-02, the source code is floating around on many 
  1774.  MM> BBSs in germany ...
  1775.  
  1776. But TeX was written by Donald Knuth, and is explicitly public domain.  I think
  1777. I remember reading about the hyphenation in TeX - it was developed by analyzing
  1778. a huge hyphenation dictionary, and looking for patterns.  
  1779.  
  1780. --- Msg V3.2
  1781.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1782.  * Tossed by SFToss v1.00b on 92/05/15  08:22:58
  1783.  
  1784. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1785.  
  1786. Conference 4
  1787. Date       05-14-92 08:21:19
  1788. From       Dj Murdoch
  1789. To         Max Maischein
  1790. Subject    Re: Impact Of .Tpu Size O
  1791.  
  1792.   MM> be linked in only when needed ... Have a look at DJ 
  1793.  MM> Murdochs TPU1.*, a TPU-Dumper, that will give you detailed 
  1794.  MM> info on TP60 TPU files.
  1795.  
  1796. Thanks for the credit, but TPU1 isn't mine.  It was written by William Peavy.
  1797.  I wrote a related program called INTRFC62.ZIP.  TPU1 goes for a more low-level
  1798. byte-oriented dump, while mine tries for a slightly higher level, showing
  1799. the logical relations but not helping you a lot about finding things for patchin
  1800. .  Either one would show that CRT is mostly one big .OBJ file, but not completel
  1801. .
  1802.  
  1803. --- Msg V3.2
  1804.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1805.  * Tossed by SFToss v1.00b on 92/05/15  08:22:58
  1806.  
  1807. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1808.  
  1809. Conference 4
  1810. Date       05-14-92 08:24:13
  1811. From       Dj Murdoch
  1812. To         Joshua Kersey @ 930/22
  1813. Subject    Re: blah...
  1814.  
  1815.   JK>  I want to copy some .PCX files onto the end of an .EXE 
  1816.  JK> file so that it's all in one file, does anyone have more 
  1817.  JK> knowledge on how to go about this and what I need to know to do this?
  1818.  
  1819. Just treat your .EXE as a resource file, and store the .PCX files each as
  1820. separate resources.  It's fairly painless.
  1821.  
  1822.  
  1823.  
  1824. --- Msg V3.2
  1825.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1826.  * Tossed by SFToss v1.00b on 92/05/15  08:22:58
  1827.  
  1828. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1829.  
  1830. Conference 4
  1831. Date       05-14-92 08:25:35
  1832. From       Dj Murdoch
  1833. To         Stephan Szabo
  1834. Subject    Re: Compression
  1835.  
  1836.   SS> Does anyone have any compression routines for TP6?
  1837.  
  1838. TPLZW by Wilbert van Leijen is a fast LZW encoder.  You can use it directly
  1839. if you can find a PDN Pascal node to get it from, or look for my STREAM11.ZIP
  1840. which puts an OOP wrapper around it.  The next version of STREAMS will probably
  1841. also include Huffman encoding.
  1842.  
  1843. --- Msg V3.2
  1844.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1845.  * Tossed by SFToss v1.00b on 92/05/15  08:22:58
  1846.  
  1847. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1848.  
  1849. Conference 4
  1850. Date       05-14-92 08:27:34
  1851. From       Dj Murdoch
  1852. To         Joe Mezzanini
  1853. Subject    Re: case/procedures
  1854.  
  1855.   JM> Can procedure's be called via a case statement
  1856.  JM> if yes then can you show me an example?
  1857.  
  1858. Yes:
  1859.  
  1860.    Case i of 
  1861.      1 : writeln('i=1');
  1862.      2 : begin
  1863.            writeln('i=2');
  1864.          end;
  1865.      else writeln('Neither 1 nor 2');
  1866.    end;
  1867.  
  1868. --- Msg V3.2
  1869.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  1870.  * Tossed by SFToss v1.00b on 92/05/15  08:22:58
  1871.  
  1872. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1873.  
  1874. Conference 4
  1875. Date       05-15-92 02:11:10
  1876. From       Trevor Carlsen
  1877. To         Pat Maher
  1878. Subject    Scan Codes
  1879.  
  1880.  
  1881.  
  1882.  PM> Have a LEGAL copy of 6.0, but need some code to read F1, etc function 
  1883.  
  1884.  PM> keys cleanly. I stumbled across the SCANCODE.???? code that is in 6.0, 
  1885.  
  1886.  PM> but it is not documented, as far as I can tell. Anyone have some code 
  1887.  
  1888.  PM> that I could use as a function? Something like CH := SCANKEY; instead 
  1889.  
  1890.  PM> of CH := READKEY; ?? 
  1891.  
  1892. I posted a keyinput unit here in the last few days that will do what you want.
  1893. It was 4 messages long so I won't post it again so do a search of the message
  1894. base on your board for the words "Keyboard input unit" and you will find it.
  1895.  
  1896. TeeCee
  1897.  
  1898. --- TC-ED   v2.01  
  1899.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1900.  * Tossed by SFToss v1.00b on 92/05/15  20:53:06
  1901.  
  1902. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1903.  
  1904. Conference 4
  1905. Date       05-15-92 02:15:07
  1906. From       Trevor Carlsen
  1907. To         Brian Stark
  1908. Subject    Re: UNIX style timestamp
  1909.  
  1910.  
  1911.  
  1912.  BS> Function IsLeapYear(Source : Word) : Boolean;
  1913.  BS> {}
  1914.  BS> Begin
  1915.  BS>   If (Source Mod 4 = 0) Or (( Source Div 10 = 0) And
  1916.  BS>   Source Div 400 = 0) Then
  1917.  BS>     IsLeapYear := True
  1918.  BS>   Else
  1919.  BS>     IsLeapYear := False;
  1920.  BS> End;
  1921.  
  1922. Brian, your original IsLeapYear function was fine for that unit.  As you are
  1923. obviously aware, Unix timestamps use the number of seconds that have elapsed
  1924. since Jan 1970. With the limitations of a longint, no year after that time
  1925. can exist that is not a leap year if it is divisible by 4.
  1926.  
  1927. Having said that, the above function is incorrect!  It should read -
  1928.   
  1929. IsLeapYear := ((Source mod 4 = 0) and (Source mod 100 <> 0)) or 
  1930.               (Source mod 400 = 0);
  1931.  
  1932. BTW, I am puzzled by your use of time zones in your unit. Is this a required
  1933. feature of unix timestamps or something that you have decided to incorporate
  1934. for FidoNet?
  1935.  
  1936. TeeCee
  1937.  
  1938.  
  1939.  
  1940.  
  1941. --- TC-ED   v2.01  
  1942.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1943.  * Tossed by SFToss v1.00b on 92/05/15  20:53:06
  1944.  
  1945. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1946.  
  1947. Conference 4
  1948. Date       05-15-92 02:40:22
  1949. From       Trevor Carlsen
  1950. To         Dj Murdoch
  1951. Subject    Re: Over my head....
  1952.  
  1953.  
  1954.  
  1955.  TC>   begin
  1956.  TC>     GoodSoFar := true;
  1957.  TC>     if (length(mask) = 0) and (length(name) <> 0) then
  1958.  TC>       GoodSoFar := false
  1959.  TC>     else
  1960.  TC>       for x := 1 to length(mask) do
  1961.  TC>         if (mask[x] <> '*') and GoodSoFar then
  1962.  TC>           if mask[x] <> '?' then
  1963.  TC>             if mask[x] <> name[x] then
  1964.  TC>               GoodSoFar := false;
  1965.  TC>     Matches := GoodSoFar;
  1966.  TC>   end;  { Matches }
  1967.  
  1968.  DM> Won't this version still have trouble with embedded asterisks?  E.g. 
  1969.  
  1970.  DM> if mask='*.pas', it looks as though it won't match "test.pas".  Or did 
  1971.  
  1972.  DM> you do something to the mask so that's not possible?
  1973.  
  1974. I don't have my message here now but there are two calls to this function,
  1975. one for the name and one for the extension. Both the filename and the mask
  1976. are split in this way first.  I think that answers your query.
  1977.  
  1978. TeeCee
  1979.  
  1980. --- TC-ED   v2.01  
  1981.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1982.  * Tossed by SFToss v1.00b on 92/05/15  20:53:06
  1983.  
  1984. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1985.  
  1986. Conference 4
  1987. Date       05-15-92 02:45:26
  1988. From       Trevor Carlsen
  1989. To         David G. Edwards
  1990. Subject    Re: Procedures...
  1991.  
  1992.  
  1993.  
  1994.  DG> I think that exit procedures should be reserved for system-type 
  1995.  DG> cleanup such as restoring interrupt vectors.  Closing files and other 
  1996.  
  1997.  DG> such "standard" stuff should be done with regular proc's.  IMO, an 
  1998.  DG> exit proc should be as short and "clean" as possible.
  1999.  
  2000. Why?  TP gives me the tool so I use it.  I have no qualms about many different
  2001. exit procedures - even perhaps one per unit if it is justified!
  2002.  
  2003. I guess you and I agree on keeping them as concise and clean as possible though
  2004. because I regard my whole program in that light!  :-)
  2005.  
  2006. TeeCee
  2007.  
  2008.  
  2009. --- TC-ED   v2.01  
  2010.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2011.  * Tossed by SFToss v1.00b on 92/05/15  20:53:07
  2012.  
  2013. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2014.  
  2015. Conference 4
  2016. Date       05-15-92 02:53:33
  2017. From       Trevor Carlsen
  2018. To         Kevin Higgins
  2019. Subject    Encryption of sorts..
  2020.  
  2021.  
  2022.  
  2023.  > I think a better idea is to attack the problem directly:  put in
  2024.  > integrity checking code, and make sure it isn't easy to subvert it.
  2025.  KH>     But how do you do this without substantial delays while checking a 
  2026.  
  2027.  KH> large .exe (or even more likely, a huge .ovr file)?
  2028.  
  2029. In all my current work I code on the assumption that the lowest base configurati
  2030. n is a '386.  I can do that as I don't write any stuff at all that is destined,
  2031. or at least intended, for a mass commercial market.
  2032.  
  2033. Integrity checking code, even full scale encryption of the complete file can
  2034. easily be done in under 2 seconds on exes up to about 250K.  At startup I
  2035. consider upto 3 or even 4 seconds delay acceptable.
  2036.  
  2037. TeeCee
  2038.  
  2039. --- TC-ED   v2.01  
  2040.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2041.  * Tossed by SFToss v1.00b on 92/05/15  20:53:07
  2042.  
  2043. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2044.  
  2045. Conference 4
  2046. Date       05-13-92 17:47:23
  2047. From       Mark Ouellet
  2048. To         KEVIN PARADINE
  2049. Subject    Re: Multiuser databases
  2050.  
  2051.  
  2052.     On 04 Jan 80, you, KEVIN PARADINE, of 1:107/480.0 wrote...
  2053.  
  2054.  >> KP> You're better off locking the whole database, rather than a 
  2055.  >> record.
  2056.  >> KP> Why?
  2057.  
  2058.  >>        Sorry but I disagree, we are using multiple
  2059.  >>relations on an application at the office and our first rule
  2060.  >>is if you can't lock records in every file pertaining to the
  2061.  >>current operation [IE: if deleting a record we lock all
  2062.  >>related records in every other database before going on]
  2063.  >>then we simply abort the operation or suspend it until ALL
  2064.  >>records can be securely worked on.
  2065.  
  2066.  >>        Our next step is networking it and what you
  2067.  >>described was something we wanted to avoid at all costs.
  2068.  >>That's why we either secure our environement before doing
  2069.  >>anything else or don't do anything.
  2070.  
  2071.  KP> ? You seem to be saying the same thing I am.
  2072.  
  2073. KEVIN,
  2074.         Not exactly, YOU RECOMMENDED LOCKING THE WHOLE
  2075. DATABASE rather than LOCKING ON A RECORD BY RECORD BASIS.
  2076.  
  2077.         THIS IS THE ABOLUTE WORSE PROGRAMMING PRACTICE IN A
  2078. NETWORK ENVIRONEMENT.
  2079.  
  2080.         And it is not what I was saying but you only quoted
  2081. what seemed to promote your point and left out the important
  2082. part.
  2083.  
  2084.         NetWorking implies sharing the data, having one
  2085. single copy on the server but not sharing it does not
  2086. warrant the use of a network since most NetWorks are
  2087. installed in offices where the majority of stations allready
  2088. have more than enough disk space. So using a NetWork to
  2089. reduce the number of copies is not viable if you don't
  2090. intend it to be shareable.
  2091.  
  2092.         You can't just hog the database and keep it from
  2093. being used by other stations. Our approach keeps it
  2094. available to others as long as they don't try to modify the
  2095. same record we are working on, but they can examine the one
  2096. we are working on simultaneously and see the changes appear
  2097. on their screen as we make them therefor giving them the
  2098. most up to date info without loss of time to us or them. And
  2099. that is what NetWorking is all about, shareing data.
  2100.  
  2101.         Best regards,
  2102.         Mark Ouellet.
  2103.  
  2104.  
  2105.  
  2106. --- ME2
  2107.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2108.  * Tossed by SFToss v1.00b on 92/05/15  20:53:14
  2109.  
  2110. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2111.  
  2112. Conference 4
  2113. Date       05-13-92 19:20:31
  2114. From       Mark Ouellet
  2115. To         Mike Copeland
  2116. Subject    Re: Pascal Style #2
  2117.  
  2118.  
  2119.     On 10 May 92, you, Mike Copeland, of 1:114/18.10 wrote...
  2120.  
  2121.  JM>>Here is something else on which I'd like to hear people's opinion.
  2122.  JM>>Which is better Pascal style:
  2123.  
  2124.  JM>>x := 1;
  2125.  JM>>if y > 10 then x := 2;
  2126.  
  2127.  JM>>or
  2128.  
  2129.  JM>>if y > 10
  2130.  JM>>  then x := 2
  2131.  JM>>  else x := 1;
  2132.  
  2133.  JM>>I'm more concerned with the programmer-level reasons, rather than
  2134.  JM>>execution speed or code size.
  2135.  
  2136.  MC> I tend to use the former (establishing a default), to show and assert 
  2137.  
  2138.  MC> that _something_ is assigned to the variable.  I also believe that it 
  2139.  
  2140.  MC> tends to avoid certains data-related bugs, since there is always a valid 
  2141.  
  2142.  MC> value...
  2143.  MC> Also, I feel there is value in showing how the non-default 
  2144.  MC> condition/value is established - since it's an exception. To my 
  2145.  MC> knowledge, there is no performance difference either way.
  2146.  
  2147. Mike,
  2148.         The difference is in debugging of course !!!! Having
  2149.         single statements/lines allows to break on any
  2150.         statement.
  2151.  
  2152.         Best regards,
  2153.         Mark Ouellet.
  2154.  
  2155.  
  2156.  
  2157. --- ME2
  2158.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2159.  * Tossed by SFToss v1.00b on 92/05/15  20:53:14
  2160.  
  2161. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2162.  
  2163. Conference 4
  2164. Date       05-13-92 20:05:22
  2165. From       Mark Ouellet
  2166. To         Jason Schlachet
  2167. Subject    Re: Multiuser databases
  2168.  
  2169.  
  2170.     On 12 May 92, you, Jason Schlachet, of 1:231/70.0 wrote...
  2171.  
  2172.  JS> If you are writing a muli-user database application, I highly recommend 
  2173.  
  2174.  JS> Clipper, or better yet, Foxpro/Lan. Both offer file sharing and 
  2175.  JS> file/record locking. I have used Foxpro/Lan to help develop a multi-user 
  2176.  
  2177.  JS> application, and ALL users can share the same files at the same time. 
  2178.  
  2179.  JS> Foxpro will run on Novell or Lantastic (the two that I've SEEN it work 
  2180.  
  2181.  JS> on).
  2182.  
  2183. Thanks Jason,
  2184.         I would have jumped on the FoxPro band-wagon years
  2185. ago if it hadn't been for regulations. We can't even buy
  2186. more Dbase's, we can only upgrade those we have. You know
  2187. how governements can be ;-) So we're stuck with Dbase IV but
  2188. since Borland is now in the picture things should really get
  2189. rolling. They allready got a 1.5 out and one for windoes and
  2190. I'm anxiously waiting for the promised compiler. Shouldn't
  2191. be too long since they allready produced more in 4 months
  2192. than Ashton-tate did in 4 years.
  2193.  
  2194.         Best regards,
  2195.         Mark Ouellet.
  2196.  
  2197.  
  2198.  
  2199. --- ME2
  2200.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2201.  * Tossed by SFToss v1.00b on 92/05/15  20:53:14
  2202.  
  2203. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2204.  
  2205. Conference 4
  2206. Date       05-13-92 20:10:09
  2207. From       Mark Ouellet
  2208. To         All
  2209. Subject    TVision Menu generation
  2210.  
  2211.  
  2212. Hi All,
  2213.         I got dlgdsn and menugen but someone stated they
  2214. were almost ready to produce a new one with more features
  2215. than these two which I personnaly find limited.
  2216.  
  2217.         The new version was supposed to support more types
  2218. and features.
  2219.  
  2220.         Does anyone remember this or who was producing the
  2221. stuff and does anyone know if it has been released yet ????
  2222.  
  2223.         Best regards,
  2224.         Mark Ouellet.
  2225.  
  2226.  
  2227.  
  2228. --- ME2
  2229.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2230.  * Tossed by SFToss v1.00b on 92/05/15  20:53:14
  2231.  
  2232. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2233.  
  2234. Conference 4
  2235. Date       05-13-92 20:14:07
  2236. From       Mark Ouellet
  2237. To         Joy Mukherjee
  2238. Subject    Re: Pascal source
  2239.  
  2240.  
  2241.     On 10 May 92, you, Joy Mukherjee, of 1:387/255.0 wrote...
  2242.  
  2243.  SJ>> You have TurboCity at 1:208/2 but you can also poll me for that. Use
  2244.  SJ>> the magic word PAS to get a list of Pasacal source available here.
  2245.  
  2246.  JM> I tried it, and it didn't work!  What is the correct file name?
  2247.  
  2248. Joy,
  2249.         I beleive the MAGIC NAME OF 'PAS' will only work on
  2250. HIS node which is in zone 2. The other turbo city is
  2251. probably not related in any way.
  2252.  
  2253.         Best regards,
  2254.         Mark Ouellet.
  2255.  
  2256.  
  2257.  
  2258. --- ME2
  2259.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2260.  * Tossed by SFToss v1.00b on 92/05/15  20:53:14
  2261.  
  2262. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2263.  
  2264. Conference 4
  2265. Date       05-15-92 08:17:00
  2266. From       Dj Murdoch
  2267. To         Edward Kmett
  2268. Subject    Re: TP6 Variable errors
  2269.  
  2270.   EK> *** Quoting Dj Murdoch to Andrew Krywaniuk dated 05-08-92 ***
  2271.  EK> > Read the answer as a string - that should always succeed.  Then use the
  2272.  
  2273.  EK> > Val procedure to convert it to an integer, and check the "Code" 
  2274.  EK> > parameter to see if there was a conversion error.
  2275.  EK> > 
  2276.  
  2277.  EK> Couldn't you just disable IO checking and read it in 
  2278.  EK> until there isn't an error?
  2279.  
  2280. I've never tried it that way, but it sounds as though it should work.  You'd
  2281. want to distinguish non-numeric input from other I/O errors, but that would
  2282. just mean you'd have to look at the value of IOResult. 
  2283.  
  2284. One disadvantage is that you can't give meaningful error messages.  It's much
  2285. nicer for the user to see a message like:
  2286.  
  2287. Cannot read "Fourteen" as a number.
  2288.  
  2289. than
  2290.  
  2291. Non-numeric input.
  2292.  
  2293. --- Msg V3.2
  2294.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  2295.  * Tossed by SFToss v1.00b on 92/05/16  14:05:59
  2296.  
  2297. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2298.  
  2299. Conference 4
  2300. Date       05-15-92 08:32:56
  2301. From       Dj Murdoch
  2302. To         Dan Vanderboom
  2303. Subject    Re: Parallel Communications
  2304.  
  2305.   DV> Asking a few questions here and there, I was able to get a 
  2306.  DV> few good books and a firm grasp on serial communications 
  2307.  DV> programming. (Thanks.)  I now have a project in front of 
  2308.  DV> me that requires the use of a parallel port (a robotics assembly line).
  2309.  DV>  
  2310.  DV> Does anyone have a suggestion as to where to look for this 
  2311.  DV> type of information, or am I forced to tediously scan 
  2312.  DV> through all of Ralf Brown's interrupt list?  ;)
  2313.  
  2314. I know almost nothing about parallel ports, but if I wanted to find out, I'd
  2315. look in Robert Jourdain's book, "Programmer's Problem Solver for the IBM PC,
  2316. XT, and AT".  It's a little old; there might be a newer edition by now.
  2317.  
  2318. And rather than looking through Brown's list, get a copy of the book version
  2319. of it:  Ralf Brown and Jim Kyle, "PC Interrupts", ISBN 0-201-57797-6.  It
  2320. has a good index.
  2321.  
  2322. --- Msg V3.2
  2323.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  2324.  * Tossed by SFToss v1.00b on 92/05/16  14:05:59
  2325.  
  2326. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2327.  
  2328. Conference 4
  2329. Date       05-15-92 08:44:38
  2330. From       Dj Murdoch
  2331. To         Trevor Carlsen
  2332. Subject    Re: Encryption of sorts.
  2333.  
  2334.   TC> Here is the endecode unit.
  2335.  
  2336. Nice unit!  I'd suggest one minor change, though:
  2337.  
  2338.  TC> function MakeCodeStr(key : longint; s: string): string;
  2339.  
  2340.  TC>   begin
  2341.  TC>     RandSeed := (key * len) DIV st[len];
  2342.  
  2343. Just so that you don't have unintended side effects, I'd save the old RandSeed
  2344. and restore it at the end of the routine.  
  2345.  
  2346.  
  2347. --- Msg V3.2
  2348.  * Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
  2349.  * Tossed by SFToss v1.00b on 92/05/16  14:05:59
  2350.  
  2351. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2352.  
  2353. Conference 4
  2354. Date       05-15-92 22:50:56
  2355. From       Mark Ouellet
  2356. To         Derek Mahar
  2357. Subject    Re: GetPixel
  2358.  
  2359.  
  2360.     On 14 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
  2361.  
  2362.  DM> In a message on <May 12 23:04>, Mark Ouellet (1:240/1.4) writes:
  2363.  DM> 
  2364.  MO>>         Exchanging al with ah multiplies AX * 256 which is
  2365.  
  2366.  DM> This is what I don't understand.  Suppose AX is 0101h.  XCHG AL,AH 
  2367.  DM> results in the same 0101h.  If AH is always 0, such as when AX is 0001h, 
  2368.  
  2369.  DM> then I can see how exchanging AL and AH results in a multiplication by 
  2370.  
  2371.  DM> 256.  Should I assume AH will always be zero?
  2372.  
  2373. Derek,
  2374.         You are correct and I did make the distinction in a
  2375. later message on this same subject. The value to be
  2376. multiplied MUST be lower than 256 so as not to encounter
  2377. what you described. Anything higher would be more like a
  2378. rotate of the register than a shift of it.
  2379.  
  2380.         Never the less the technique can be applied to
  2381. larger numbers but is a bit more tricky. In any case, using
  2382. this method on numbers < 256 does save CPU clock cycles
  2383. compared to a MUL instruction.
  2384.  
  2385.         And to answer you last question... NEVER ASSUME
  2386. anything the value must ABSOLUTELY be < 256.
  2387.  
  2388.         Best regards,
  2389.         Mark Ouellet.
  2390.  
  2391.  
  2392.  
  2393. --- ME2
  2394.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2395.  * Tossed by SFToss v1.00b on 92/05/16  14:05:59
  2396.  
  2397. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2398.  
  2399. Conference 4
  2400. Date       05-15-92 23:06:23
  2401. From       Mark Ouellet
  2402. To         Jud Mccranie
  2403. Subject    Re: Help - Reading Records At
  2404.  
  2405.  
  2406.     On 14 May 92, you, Jud Mccranie, of 1:3645/10.0 wrote...
  2407.  
  2408.  JM> In TP, is there any good way to read records starting at a position in
  2409.  JM> the file that is not a multiple of the record length?
  2410.  JM> 
  2411.  JM> I'm converting some files from one format to another, and the record
  2412.  JM> length is something like 331 bytes, but I need to ignore the first 255
  2413.  JM> bytes and then start reading records.  I know I can first make a copy
  2414.  JM> the file omitting the trash at the front, but is there a better way to
  2415.  JM> do it?  (Seek works on records, not bytes.)
  2416.  
  2417. Jud,
  2418.         Seek DOES work on bytes if you declare your record to be of 1 byte
  2419. length.
  2420.  
  2421.         To do what you want you'll have to compute the offset yourself. From
  2422. the looks of things you seem to want to read some sort of database and want to
  2423.  
  2424. skip the header part.
  2425.  
  2426. Do it like this:
  2427.  
  2428. Suppose header is 255 bytes and each record is 331 bytes long:
  2429.  
  2430. TYPE
  2431.     One_Record = RECORD
  2432.         331 bytes long structure;
  2433.     END;
  2434.  
  2435.     One_Header = RECORD
  2436.         255 bytes defining header struc.
  2437.     END;
  2438.  
  2439. VAR
  2440.     My_Record : One_Record;
  2441.     My_Header : One_Header;
  2442.     My_File : FILE;
  2443.     My_File_Name : STRING;
  2444.     Bytes_To_Read : WORD;
  2445.     Bytes_Read : WORD;
  2446.     Record_To_Get : WORD;
  2447.     Offset_Of_Record : LONGINT;
  2448.  
  2449. BEGIN
  2450.     My_File_Name := 'Clients.dbf';
  2451.     ASSIGN(My_File, My_File_Name);
  2452.     RESET(My_File, 1);
  2453.                   {^ important}
  2454.     SEEK(My_File, 0);
  2455.     Bytes_To_Read := SIZEOF(One_Header);
  2456.     BLOCKREAD(My_file, My_Header, Bytes_To_Read, Bytes_Read);
  2457.     IF (Bytes_Read <> Bytes_To_Read) THEN BEGIN
  2458.         WRITELN('Could not read in header');
  2459.         HALT(1);
  2460.     END ELSE BEGIN
  2461.         WRITELN('Header read and being processed');
  2462.     END;
  2463.  
  2464.     { To get record 400 (Zero based) }
  2465.  
  2466.     Record_To_Get := 400;
  2467.     Bytes_To_Read := SIZEOF(One_Record);
  2468.     Offset_Of_Record := SIZEOF(One_Header) +
  2469.                         (Record_To_Get * Bytes_To_Read);
  2470.  
  2471.     SEEK(My_File, Offset_Of_Record);
  2472.     BLOCKREAD(My_File, My_Record, Bytes_To_Read, Bytes_Read);
  2473. END.
  2474.  
  2475.     As you can see it's only logical, you know the size of the header and you
  2476.  
  2477. know the size of each record so you can compute the offset. When you deal with
  2478.  
  2479. untyped files with no header, that is all TP is really doing for you.
  2480.  
  2481.         Best regards,
  2482.         Mark Ouellet.
  2483.  
  2484.  
  2485.  
  2486. --- ME2
  2487.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2488.  * Tossed by SFToss v1.00b on 92/05/16  14:05:59
  2489.  
  2490. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2491.  
  2492. Conference 4
  2493. Date       05-15-92 23:28:00
  2494. From       Mark Ouellet
  2495. To         Jud Mccranie
  2496. Subject    Re: Pascal Style #2
  2497.  
  2498.  
  2499.     On 15 May 92, you, Jud Mccranie, of 1:3645/10.0 wrote...
  2500.  
  2501.  GT>> This is because I can
  2502.  GT>> add a statement to the block without thinking about having to
  2503.  GT>> add a begin/end. The begin/end block don't affect the exicution
  2504.  GT>> speed but do help readability.
  2505.  
  2506.  JM> I see that point but I don't believe I add to a 1 statement block very
  2507.  JM> often.
  2508.  
  2509. Jud,
  2510.         It may be so but, I do it that same way to because
  2511. only a 1 statement block will ever need a begin-end pair
  2512. added if I do add statements.
  2513.  
  2514.         Best regards,
  2515.         Mark Ouellet.
  2516.  
  2517.  
  2518.  
  2519. --- ME2
  2520.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2521.  * Tossed by SFToss v1.00b on 92/05/16  14:05:59
  2522.  
  2523. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2524.  
  2525. Conference 4
  2526. Date       05-15-92 07:27:18
  2527. From       Mark Ouellet
  2528. To         Derek Mahar
  2529. Subject    Re: Fast video (was: thanks)
  2530.  
  2531.  
  2532.     On 13 May 92, you, Derek Mahar, of 1:167/110.0 wrote...
  2533.  
  2534.  DM> In a message on <May 10 11:30>, Gerald Gutierrez (1:153/715.5Derekidonet) 
  2535.  
  2536.  DM> writes:
  2537.  DM> 
  2538.  GG>> Multiply 253 by 160:
  2539.  
  2540.  GG>> mov  bx,253
  2541.  GG>> xchg bh,bl
  2542.  GG>> shr  bx,1
  2543.  GG>> mov  ax,bx
  2544.  GG>> shr  bx,1
  2545.  GG>> shr  bx,1
  2546.  GG>> add  ax,bx
  2547.  
  2548.  DM> Can you explain to me how this works?  Escpecially the role of the line 
  2549.  
  2550.  DM> XCHG BH,BL.
  2551.  
  2552. Derek,
  2553.         It's as allways based on the base 2 multiplication.
  2554. Since shifting a register X number of bits left or right
  2555. equals multiplying or dividing that register by the
  2556. equivalent power of 2 ie: shr AX, 2 would divide AX by 4 or
  2557. by (2^2). Now since any number from 1 to 256 can be
  2558. decomposed into it's (powers of 2) constituants ie: 160 is
  2559. really 128 + 32, 161 is 128 + 32 + 1. This way you create
  2560. each component, add them and if by any chance you are
  2561. multiplying by an ODD number simply initialise the output
  2562. register with the original value.
  2563.  
  2564. Example 253 * 160
  2565.  mov  bx,253       {Move value to BX}
  2566.  
  2567.  xchg bh,bl        { this essentially multiplies BX by 256 }
  2568.                      it's the same as shr BX, 8, except this
  2569.                      one works as long as the value to
  2570.                      multiply is lower than 256 since any
  2571.                      bit set in bh would be lost. SHR BX,8
  2572.                      essentially moves the lower 8 bits of
  2573.                      BX into its high part}
  2574.  
  2575.  shr  bx,1         { Up to this point BX = 253 * 256,
  2576.                      shifting this right once divides it by
  2577.                      2 making it 253 * (256/2)=.... you
  2578.                      guessed it, 253 * 128}
  2579.  
  2580.  mov  ax,bx        { save that into AX }
  2581.  
  2582.  shr  bx,1         { divide by 2 again = 253 * 64 }
  2583.  shr  bx,1         { again = 253 * 32 }
  2584.  
  2585.  add  ax,bx        { Now (253*128) + (253*32) = 253*(128+32)
  2586.                      which equals 253*160 }
  2587.  
  2588.  
  2589. As you can see, since any number < 256 is composed of
  2590. multiples of 2 added together, any multiplication can be
  2591. made this way avoiding the use of MUL which is time
  2592. consumming for the CPU.
  2593.  
  2594.  
  2595.         Best regards,
  2596.         Mark Ouellet.
  2597.  
  2598.  
  2599.  
  2600. --- ME2
  2601.  * Origin: One BEER gets me drunk.... usualy the 47th ;-) (Fidonet 1:240/1.4)
  2602.  * Tossed by SFToss v1.00b on 92/05/16  14:05:59
  2603.  
  2604. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2605.  
  2606. Conference 4
  2607. Date       05-16-92 02:56:05
  2608. From       Trevor Carlsen
  2609. To         Jud Mccranie
  2610. Subject    Help - Reading Records At
  2611.  
  2612.  
  2613.  
  2614.  JM> In TP, is there any good way to read records starting at a position in
  2615.  JM> the file that is not a multiple of the record length?
  2616.  
  2617.  JM> I'm converting some files from one format to another, and the record
  2618.  JM> length is something like 331 bytes, but I need to ignore the first 255
  2619.  JM> bytes and then start reading records.  I know I can first make a copy
  2620.  JM> the file omitting the trash at the front, but is there a better way to
  2621.  JM> do it?  (Seek works on records, not bytes.)
  2622.  
  2623. uses dos;
  2624. const
  2625.   Offset     : word = 331;
  2626. var
  2627.   YourRec : RecordType;
  2628.   f       : file of RecordType;  { open in the normal way }
  2629.  
  2630. procedure ReadRec(var f; RecNo: longint; var Rec);
  2631.   var
  2632.     OldSize : word;
  2633.   begin
  2634.     with FileRec(f) do begin
  2635.       OldSize := RecSize;
  2636.       {$I-};
  2637.       seek(file(f),(RecNo * OldSize)+Offset);
  2638.       CheckIO; { to check IOResult.  Put whatever is needed in this }
  2639.       RecSize := OldSize;
  2640.       BlockRead(file(f),Rec,1);
  2641.       CheckIO;
  2642.       {$I+}
  2643.     end; { with }
  2644.   end;
  2645.  
  2646. Untested.  That is purely to allow the file to be declared as being of the
  2647. type in YourRecord.  It may be better to just bite the bullet and open it
  2648. as an untyped file of record length 1.  Then seek to the calculated file offset
  2649. and read the number of bytes needed for a record.
  2650.  
  2651. TeeCee
  2652.  
  2653. --- TC-ED   v2.01  
  2654.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2655.  * Tossed by SFToss v1.00b on 92/05/16  18:48:25
  2656.  
  2657. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2658.  
  2659. Conference 4
  2660. Date       05-16-92 03:17:47
  2661. From       Trevor Carlsen
  2662. To         Matt Heck
  2663. Subject    GIFSlow ?
  2664.  
  2665.  
  2666.  
  2667.  MH>      Trevor, this is somewhat large, but it will help alot of people, 
  2668.  
  2669.  MH> is this okay to post?
  2670.  
  2671.  MH> If he says okay, than if you post some Sound Blaster code (preferably 
  2672.  
  2673.  MH> that which uses internal routines, not the drivers) I'll toss up 
  2674.  MH> GIFSLOW.
  2675.  
  2676. You don't say how big it is.  If it is more than, say 4 100 line messages,
  2677. I'd prefer to see you ask your sysop to make it available for FREQing, and
  2678. then advising GG of that.  Another way is to ask your sysop to hatch it into
  2679. the PDN.
  2680.  
  2681. TeeCee
  2682.  
  2683. --- TC-ED   v2.01  
  2684.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2685.  * Tossed by SFToss v1.00b on 92/05/16  18:48:25
  2686.  
  2687. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2688.  
  2689. Conference 4
  2690. Date       05-16-92 03:23:07
  2691. From       Trevor Carlsen
  2692. To         Chris Kelling
  2693. Subject    Re: A Virtuous Pascal ...
  2694.  
  2695.  
  2696.  
  2697.  CK> And VAX PASCAL blows TP out  of the water.
  2698.  
  2699. Having used both, I can't say I agree with that, unless recent versions of
  2700. the VAX product have improved significantly. Instead of just making such a
  2701. statement why don't you post your reasons also?
  2702.  
  2703. I feel VAX Pascal has an advantage over TP where standard Pascal syntax is
  2704. necessary - particularly in regard to file I/O.  TP runs rings around it with
  2705. its bit manipulation, general file (non standard) I/O, machine guts level
  2706. stuff etc.  
  2707.  
  2708. However as they run on totally different platforms, that is hardly what I'd
  2709. call a fair comparison.  VAX Pascal is the best Pascal for the VAX (for all
  2710. I know it may be the ONLY Pascal for the VAX), and TP is, IMHO, the best "Pascal
  2711.  for the MS-DOS based PC environment.
  2712.  
  2713. TeeCee
  2714.  
  2715. --- TC-ED   v2.01  
  2716.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2717.  * Tossed by SFToss v1.00b on 92/05/16  18:48:25
  2718.  
  2719. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2720.  
  2721. Conference 4
  2722. Date       05-16-92 03:38:16
  2723. From       Trevor Carlsen
  2724. To         Steve Gabrilowitz
  2725. Subject    Re: Over my head....
  2726.  
  2727.  
  2728.  
  2729.  TC>  DOS does some strange things with wildcards -
  2730.  
  2731.  TC>    '*'     is the same as '*.*'
  2732.  TC>    '?'     is the same as '?.*'
  2733.  TC>    '?.'    is the same as '?.*'
  2734.  TC>    't*'    will not find any file that has an extension
  2735.  TC>    't?'    is the same as 't*'
  2736.  TC>    't?.'   is the same as 't?.*'
  2737.  
  2738.  TC>  (The above was tested using 4DOS running with DRDOS 6 ...
  2739.  
  2740.  SG> I think you're wrong about ?. being treated like ?.*, I just tried it 
  2741.  
  2742.  SG> here and it was treated differently (4DOS with MSDOS 4.01).  Now 
  2743.  SG> what's really interesting is that DOS doesn't even seem to be 
  2744.  SG> consistent with itself...
  2745.  
  2746. If using the dir command you are right. Other programs can yield different
  2747. results.  Interesting.
  2748.  
  2749. TeeCee
  2750.  
  2751.  
  2752.  
  2753.  
  2754. --- TC-ED   v2.01  
  2755.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2756.  * Tossed by SFToss v1.00b on 92/05/16  18:48:25
  2757.  
  2758. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2759.  
  2760. Conference 4
  2761. Date       05-16-92 15:53:39
  2762. From       Trevor Carlsen
  2763. To         Jud Mccranie
  2764. Subject    Help - Reading Records At
  2765.  
  2766.  
  2767.  
  2768.  JM> In TP, is there any good way to read records starting at a position in
  2769.  JM> the file that is not a multiple of the record length?
  2770.  
  2771. After posting a solution to this problem in the early hours this morning,
  2772. I realised that I had written such a function sometime ago and included it
  2773. in one of my own toolboxes.  As this version is tried and proved and is slightly
  2774. different to what I previously entered off the cuff, here 'tis -
  2775.  
  2776.  
  2777. {$I-}
  2778. function ReadRec(var f;                        { The typed or untyped file }
  2779.  
  2780.                  RecNo : longint;{ The record number to read ( zero based) }
  2781.  
  2782.                  Offset: word;                    { The size of the header }
  2783.  
  2784.                  var Rec;{ The record to be read - untyped for convenience }
  2785.  
  2786.                  ErrCode: { I/O error code } integer): boolean;
  2787.  
  2788.   { Reads a record number from a file of typed records that has an odd size}
  2789.   { header record. Returns true if read was OK.   (Requires the DOS unit)  }
  2790.  
  2791.  
  2792.   var
  2793.     OldSize,
  2794.     result  : word;
  2795.  
  2796.   begin
  2797.     with FileRec(f) do begin
  2798.       OldSize := RecSize;                  { Save the declared record size }
  2799.  
  2800.       RecSize := 1;                  { Change to a single byte record size }
  2801.  
  2802.       seek(file(f),(RecNo * OldSize) + Offset);{ Seek to calculated offset }
  2803.  
  2804.       RecSize := OldSize;                        { Restore the record size }
  2805.  
  2806.       ErrCode := IOResult;                           { Check for I/O error }
  2807.  
  2808.       if ErrCode <> 0 then { an I/O error occurred }
  2809.         ReadRec := false  
  2810.       else { no I/O error } begin
  2811.         BlockRead(file(f),Rec,1,result);            { Read a single record }
  2812.  
  2813.         ErrCode := IOResult;                         { Check for I/O error }
  2814.  
  2815.         ReadRec := (ErrCode = 0) and (result = 1);
  2816.       end; { else }
  2817.     end; { with }
  2818.   end;  { ReadRec }
  2819. {$I+}
  2820.  
  2821. To use, just open your file as a typed file of the type you need then to read
  2822. record number RecordNumber -
  2823.   
  2824.   if not ReadRec(f,RecordNumber,HeaderSize,YourRecord,ErrorCode) then
  2825.     writeln('I/O read error ',ErrorCode,' record number ',RecordNumber);
  2826.  
  2827.  
  2828. TeeCee
  2829.  
  2830.  
  2831. --- TC-ED   v2.01  
  2832.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2833.  * Tossed by SFToss v1.00b on 92/05/16  18:48:25
  2834.  
  2835. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2836.  
  2837. Conference 4
  2838. Date       05-16-92 11:14:12
  2839. From       Trevor Carlsen
  2840. To         BRIAN PAPE
  2841. Subject    Illegal origin line
  2842.  
  2843.  
  2844.  
  2845.  BP> --- Mosaic v1.00
  2846.  BP>  * Origin: "Universal Worlds" -= The Worlds Of Astronomy & Science =- 
  2847.  
  2848.  BP> (618) 931-8226
  2849.  
  2850. Brian, it is a requirement of both FidoNet and this echo that the origin line
  2851. in messages has a valid nodelisted address and does not exceed 79 characters
  2852. in length. Please fix.
  2853.  
  2854. Trevor Carlsen
  2855. Moderator.
  2856.  
  2857.  
  2858. --- TC-ED   v2.01  
  2859.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2860.  * Tossed by SFToss v1.00b on 92/05/16  18:48:25
  2861.  
  2862. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2863.  
  2864. Conference 4
  2865. Date       05-16-92 16:01:25
  2866. From       Trevor Carlsen
  2867. To         Dave Blaser
  2868. Subject    Overlay files?!
  2869.  
  2870.  
  2871.  
  2872.  DB> ... first, does anyone out there in BBS land know 
  2873.  DB> how in the heck to make TurboPascal create Overlay files? 
  2874.  DB> Is there a special unit that I have to include?
  2875.  
  2876. You do not say which TP version you own.  If TP4 then you are out of luck
  2877. as there are no overlays in that version.  If you own later versions then
  2878. the manual contains a complete chapter with a full explanation of what is
  2879. required.  So maybe you should RTFM!
  2880.  
  2881. TeeCee
  2882.  
  2883.  
  2884.  
  2885. --- TC-ED   v2.01  
  2886.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  2887.  * Tossed by SFToss v1.00b on 92/05/16  18:48:26
  2888.